add[example]: add nested routes example (#789)

This commit is contained in:
花裤衩
2018-06-21 14:26:25 +08:00
committed by GitHub
parent cbc3ddd827
commit d995cdb332
7 changed files with 61 additions and 0 deletions

View File

@@ -199,6 +199,39 @@ export const asyncRouterMap = [
]
},
{
path: '/nested',
component: Layout,
redirect: '/nested/bar/profile',
name: 'nested',
meta: {
title: 'nested',
icon: 'nested'
},
children: [
{
path: '/nested/bar', // Must write the full path
component: () => import('@/views/nested/bar/index'), // Parent router-view
name: 'bar',
meta: { title: 'bar' },
children: [
{
path: 'profile',
component: () => import('@/views/nested/bar/profile'),
name: 'bar-profile',
meta: { title: 'barProfile' }
},
{
path: 'posts',
component: () => import('@/views/nested/bar/posts'),
name: 'bar-posts',
meta: { title: 'barPosts' }
}
]
}
]
},
{
path: '/error',
component: Layout,