第一种param传参
路由表
{
path: '/xxx/xxx/:id',
name: 'xxx',
component: () => import('@/views/xxx/xxx/xxx'),
meta: { title: 'xxx详情', hidden: false, keepAlive: true, permission: ['portal'] }
}
定义跳转的页面
handleViewDoc(row) {
const { href } = this.$router.resolve({
name: 'xxx',
params: {
id: row.xxx
}
})
window.open(href, '_blank')
},
跳转后的页面接收参数
const xxx= this.$route.params.id
第二种query传参
路由表
xxx:resolve => require(['@/views/xxx/xxx/xxx/xxx'], resolve),
定义跳转的页面
handelOntest(row){
const { href } = this.$router.resolve({
path: 'xxx',
query: {
finId: row.xxx
}
})
window.open(href, '_blank')
},
跳转后的页面接收参数
const xxx= this.$route.query.finId