diff --git a/.gitignore b/.gitignore index a2069ec8..9322b8a6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ dist/ npm-debug.log* yarn-debug.log* yarn-error.log* +**/*.log test/unit/coverage test/e2e/reports diff --git a/src/lang/en.js b/src/lang/en.js index eed6fdd3..8d6e711b 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -29,9 +29,13 @@ export default { mixChart: 'Mix Chart', example: 'Example', nested: 'Nested Routes', - bar: 'Bar', - barProfile: 'Profile', - barPosts: 'Posts', + menu1: 'Menu 1', + 'menu1-1': 'Menu 1-1', + 'menu1-2': 'Menu 1-2', + 'menu1-2-1': 'Menu 1-2-1', + 'menu1-2-2': 'Menu 1-2-2', + 'menu1-3': 'Menu 1-3', + menu2: 'Menu 2', Table: 'Table', dynamicTable: 'Dynamic Table', dragTable: 'Drag Table', diff --git a/src/lang/zh.js b/src/lang/zh.js index 0c16dee8..7958b879 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -29,9 +29,13 @@ export default { mixChart: '混合图表', example: '综合实例', nested: '路由嵌套', - bar: 'Bar', - barProfile: 'Profile', - barPosts: 'Posts', + menu1: '菜单1', + 'menu1-1': '菜单1-1', + 'menu1-2': '菜单1-2', + 'menu1-2-1': '菜单1-2-1', + 'menu1-2-2': '菜单1-2-2', + 'menu1-3': '菜单1-3', + menu2: '菜单2', Table: 'Table', dynamicTable: '动态Table', dragTable: '拖拽Table', diff --git a/src/router/index.js b/src/router/index.js index aaaccd8d..1bda06f2 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -202,7 +202,7 @@ export const asyncRouterMap = [ { path: '/nested', component: Layout, - redirect: '/nested/bar/profile', + redirect: '/nested/menu1', name: 'nested', meta: { title: 'nested', @@ -210,24 +210,49 @@ export const asyncRouterMap = [ }, children: [ { - path: '/nested/bar', // Must write the full path - component: () => import('@/views/nested/bar/index'), // Parent router-view - name: 'bar', - meta: { title: 'bar' }, + path: 'menu1', + component: () => import('@/views/nested/menu1/index'), // Parent router-view + name: 'menu1', + meta: { title: 'menu1' }, children: [ { - path: 'profile', - component: () => import('@/views/nested/bar/profile'), - name: 'bar-profile', - meta: { title: 'barProfile' } + path: 'menu1-1', + component: () => import('@/views/nested/menu1/menu1-1'), + name: 'menu1-1', + meta: { title: 'menu1-1' } }, { - path: 'posts', - component: () => import('@/views/nested/bar/posts'), - name: 'bar-posts', - meta: { title: 'barPosts' } + path: 'menu1-2', + component: () => import('@/views/nested/menu1/menu1-2'), + name: 'menu1-2', + meta: { title: 'menu1-2' }, + children: [ + { + path: 'menu1-2-1', + component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'), + name: 'menu1-2-1', + meta: { title: 'menu1-2-1' } + }, + { + path: 'menu1-2-2', + component: () => import('@/views/nested/menu1/menu1-2/menu1-2-2'), + name: 'menu1-2-2', + meta: { title: 'menu1-2-2' } + } + ] + }, + { + path: 'menu1-3', + component: () => import('@/views/nested/menu1/menu1-3'), + name: 'menu1-3', + meta: { title: 'menu1-3' } } ] + }, + { + path: 'menu2', + component: () => import('@/views/nested/menu2/index'), + meta: { title: 'menu2' } } ] }, diff --git a/src/views/layout/components/Sidebar/SidebarItem.vue b/src/views/layout/components/Sidebar/SidebarItem.vue index cddcd61d..12257eb4 100644 --- a/src/views/layout/components/Sidebar/SidebarItem.vue +++ b/src/views/layout/components/Sidebar/SidebarItem.vue @@ -1,26 +1,24 @@