一、修改路由
routes: [
{
path: '/list/:id',
name: 'list'
}
]
二、传参跳转
this.$router.push({name:'list', params:{id: id}});
三、获取参数
this.$route.params.id
routes: [
{
path: '/list/:id',
name: 'list'
}
]
this.$router.push({name:'list', params:{id: id}});
this.$route.params.id