1、vue-router 做嵌套路由传值的时候,跳转到product页面的时候,已经能够收到传过来的值,但是我想跳的是默认ProA ,做了redirect重定向,能够跳转到ProA页面,但是product获取不到传过来的值,比如说id的值,这种情况要怎么解决? routes: [{ path: '/', name: 'Index', component: Index
},
{ path: '/product/:id', name: 'Product', redirect: '/product/:id/producta', component: Product, children: [{ path: 'producta', name: 'ProA', component: ProA
}, { path: 'productb', name: 'ProB', component: ProB
}, { path: 'productc', name: 'ProC', component: ProC
}]
}
]
2 回答
慕姐8265434
TA贡献1813条经验 获得超2个赞
routes: [{ path: '/', name: 'Index', component: Index }, { path: '/product/:id', name: 'Product', redirect: '/product/producta/:id', component: Product }, { path: '/product/producta/:id', name: 'ProA', component: ProA }, { path: '/product/productb', name: 'ProB', component: ProB }, { path: '/product/productc', name: 'ProC', component: ProC } ]
- 2 回答
- 0 关注
- 1958 浏览
添加回答
举报
0/150
提交
取消