fix(vue): improve path matching with tabs (#22807)

resolves #22519
This commit is contained in:
Liam DeBeasi
2021-01-22 10:19:38 -05:00
committed by GitHub
parent e2d8e5c4dc
commit 2a3ce9a74e
5 changed files with 100 additions and 18 deletions

View File

@ -110,6 +110,39 @@ const routes: Array<RouteRecordRaw> = [
}
]
},
{
path: '/tabs-new/',
component: () => import('@/views/Tabs.vue'),
children: [
{
path: '',
redirect: '/tabs-new/tab1'
},
{
path: 'tab1',
component: () => import('@/views/Tab1.vue'),
},
{
path: 'tab1/child-one',
component: () => import('@/views/Tab1ChildOne.vue')
},
{
path: 'tab1/child-two',
component: () => import('@/views/Tab1ChildTwo.vue')
},
{
path: 'tab2',
component: () => import('@/views/Tab2.vue')
},
{
path: 'tab3',
beforeEnter: (to, from, next) => {
next({ path: '/tabs/tab1' });
},
component: () => import('@/views/Tab3.vue')
}
]
},
{
path: '/tabs-secondary/',
component: () => import('@/views/TabsSecondary.vue'),