一.this.$route.query
A页面传递参数peng=0
registerInfoThis.$router.push("/hrhi/psninfo/dynamic/" + data.row.pk_psndoc + '?funcode=60070psninfo&peng=0');
运行后,传递的参数在地址栏中有显示
B页面接收参数
created() {
this.penga = this.$route.query["peng"];
},
二、this.$route.params
1、router/index.js
{
path:'/mtindex',
component: mtindex,
//添加路由
children:[
{
path:"/detail",
name:'detail',
component:guessdetail
}
]
},
2、传参数( params相对应的是name query相对应的是path)
this.$router.push({
name: ‘detail’, params:{shopid: item.id}
});
3、获取参数
this.$route.params.shopid
4、url的表现形式(url中没带参数)
http://localhost:8080/#/mtindex