vue-element-admin 面包屑导航实现子路由之间的跳转无需新打开tagViews

wpx232ag  于 2022-10-20  发布在  其他
关注(0)|答案(1)|浏览(477)

// 活动管理
{
path: '/activity',
redirect: '/activity/index',
component: Layout,
children: [{
path: 'index',
component: () => import('@/views/activity/index'),
name: 'activityIndex',
meta: {
title: '活动管理',
icon: 'dashboard',
noCache: true
}
}]
},
{
path: '/activity',
component: Layout,
redirect: '/activity/index',
name: 'activity',
hidden: true,
meta: {
title: '活动管理',
icon: 'dashboard',
noCache: true
},
children: [{
path: 'add',
component: () => import('@/views/activity/components/add'),
name: 'activityAdd',
meta: {
title: '活动添加',
noCache: true
}
},
{
path: 'edit/:id(\d+)',
component: () => import('@/views/activity/components/edit'),
name: 'activityEdit',
meta: {
title: '活动修改',
noCache: true
},
hidden: true
},
//详情页面
{
path: 'detail/:id(\d+)',
hidden: true,
component: () => import('@/views/activity/components/detail'),
name: 'activityDetail',
meta: {
title: '活动详情',
icon: 'star',
noCache: true
}
}
]
}
侧边导航只会显示一个,右侧不同子路由的切换,不会新增新的tagViews,实现了 “首页/父路由/子路由1”到“首页/父路由/子路由2”的切换,切换的同时关闭子路由1,有没有可能实现模拟浏览器的后退按钮,后退就直接返回上次的路由

fhg3lkii

fhg3lkii1#

可以增加一个变量来控制,有些页面新开不添加 tagsview。

相关问题