第一种 params 传参
patams传参,路径不能使用path
this.$router.push({name: 'index', params: {type: 1}})
获取数据:this.$route.params.type
第二种 query
this.$router.push({path: '/user/index', query: {type: 1}})
获取数据: 取数据:this.$route.query.type
注意:
params传参,push里面只能是 name:'xxxx',不能是path:'/xxx',因为params只能用name来引入路由,如果这里写成了path,接收参数页面会是undefined!!!