标题vue从一个页面跳转到另一个页面并携带参数的解决方法
fun(mallCode){
this.$router.push({
path: '/user',
query: {
name: '张三'
}
})
}
跳转页面接收参数
created(){
this.getParams()
},
methods :{
getParams(){
// 取到路由带过来的参数
const routerParams = this.$route.query.name
//....
}
},
watch: {
'$route': 'getParams'
}