From 13df78ef01d9de78a0d9acb71ef5a86a7279dfd7 Mon Sep 17 00:00:00 2001 From: Bowen Date: Sat, 7 Jul 2018 16:22:44 +0800 Subject: [PATCH] chore: update nested examples. --- .gitignore | 1 + src/lang/zh.js | 10 +++- src/router/index.js | 57 ++++++++++--------- .../layout/components/Sidebar/SidebarItem.vue | 4 +- src/views/nested/bar/foo/Ant.vue | 6 -- src/views/nested/bar/foo/Ant2.vue | 6 -- src/views/nested/bar/foo/index.vue | 6 -- src/views/nested/bar/index.vue | 7 --- src/views/nested/bar/posts.vue | 6 -- src/views/nested/bar/profile.vue | 6 -- src/views/nested/menu1/index.vue | 7 +++ src/views/nested/menu1/menu1-1/index.vue | 7 +++ src/views/nested/menu1/menu1-2/index.vue | 7 +++ .../nested/menu1/menu1-2/menu1-2-1/index.vue | 5 ++ .../nested/menu1/menu1-2/menu1-2-2/index.vue | 5 ++ src/views/nested/menu1/menu1-3/index.vue | 5 ++ src/views/nested/menu2/index.vue | 5 ++ 17 files changed, 81 insertions(+), 69 deletions(-) delete mode 100644 src/views/nested/bar/foo/Ant.vue delete mode 100644 src/views/nested/bar/foo/Ant2.vue delete mode 100644 src/views/nested/bar/foo/index.vue delete mode 100644 src/views/nested/bar/index.vue delete mode 100644 src/views/nested/bar/posts.vue delete mode 100644 src/views/nested/bar/profile.vue create mode 100644 src/views/nested/menu1/index.vue create mode 100644 src/views/nested/menu1/menu1-1/index.vue create mode 100644 src/views/nested/menu1/menu1-2/index.vue create mode 100644 src/views/nested/menu1/menu1-2/menu1-2-1/index.vue create mode 100644 src/views/nested/menu1/menu1-2/menu1-2-2/index.vue create mode 100644 src/views/nested/menu1/menu1-3/index.vue create mode 100644 src/views/nested/menu2/index.vue 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/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 a455dd2e..4cfb0c9d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -210,44 +210,49 @@ export const asyncRouterMap = [ }, children: [ { - path: 'bar', - 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: 'foo', - component: () => import('@/views/nested/bar/foo'), - name: 'bar-foo', - meta: { title: 'Foo' }, + path: 'menu1-2', + component: () => import('@/views/nested/menu1/menu1-2'), + name: 'menu1-2', + meta: { title: 'menu1-2' }, children: [ { - path: 'ant', - component: () => import('@/views/nested/bar/foo/Ant'), - name: 'bar-foo-ant', - meta: { title: 'Ant' } + path: 'menu1-2-1', + component: () => import('@/views/nested/menu1/menu1-2/menu1-2-1'), + name: 'menu1-2-1', + meta: { title: 'menu1-2-1' } }, { - path: 'ant2', - component: () => import('@/views/nested/bar/foo/Ant2'), - name: 'bar-foo-ant2', - meta: { title: 'Ant2' } + path: 'menu1-2-12', + 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 2f839ae2..12257eb4 100644 --- a/src/views/layout/components/Sidebar/SidebarItem.vue +++ b/src/views/layout/components/Sidebar/SidebarItem.vue @@ -1,6 +1,5 @@ diff --git a/src/views/nested/bar/foo/Ant.vue b/src/views/nested/bar/foo/Ant.vue deleted file mode 100644 index 4f2e9137..00000000 --- a/src/views/nested/bar/foo/Ant.vue +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/src/views/nested/bar/foo/Ant2.vue b/src/views/nested/bar/foo/Ant2.vue deleted file mode 100644 index c9e736e6..00000000 --- a/src/views/nested/bar/foo/Ant2.vue +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/src/views/nested/bar/foo/index.vue b/src/views/nested/bar/foo/index.vue deleted file mode 100644 index e5b3e3c9..00000000 --- a/src/views/nested/bar/foo/index.vue +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/src/views/nested/bar/index.vue b/src/views/nested/bar/index.vue deleted file mode 100644 index 37c0c992..00000000 --- a/src/views/nested/bar/index.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/src/views/nested/bar/posts.vue b/src/views/nested/bar/posts.vue deleted file mode 100644 index 22d29db2..00000000 --- a/src/views/nested/bar/posts.vue +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/src/views/nested/bar/profile.vue b/src/views/nested/bar/profile.vue deleted file mode 100644 index 57316cd5..00000000 --- a/src/views/nested/bar/profile.vue +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/src/views/nested/menu1/index.vue b/src/views/nested/menu1/index.vue new file mode 100644 index 00000000..bdd5fc82 --- /dev/null +++ b/src/views/nested/menu1/index.vue @@ -0,0 +1,7 @@ + diff --git a/src/views/nested/menu1/menu1-1/index.vue b/src/views/nested/menu1/menu1-1/index.vue new file mode 100644 index 00000000..44da904c --- /dev/null +++ b/src/views/nested/menu1/menu1-1/index.vue @@ -0,0 +1,7 @@ + diff --git a/src/views/nested/menu1/menu1-2/index.vue b/src/views/nested/menu1/menu1-2/index.vue new file mode 100644 index 00000000..19ba25d0 --- /dev/null +++ b/src/views/nested/menu1/menu1-2/index.vue @@ -0,0 +1,7 @@ + diff --git a/src/views/nested/menu1/menu1-2/menu1-2-1/index.vue b/src/views/nested/menu1/menu1-2/menu1-2-1/index.vue new file mode 100644 index 00000000..ac82b31c --- /dev/null +++ b/src/views/nested/menu1/menu1-2/menu1-2-1/index.vue @@ -0,0 +1,5 @@ + diff --git a/src/views/nested/menu1/menu1-2/menu1-2-2/index.vue b/src/views/nested/menu1/menu1-2/menu1-2-2/index.vue new file mode 100644 index 00000000..e976c730 --- /dev/null +++ b/src/views/nested/menu1/menu1-2/menu1-2-2/index.vue @@ -0,0 +1,5 @@ + diff --git a/src/views/nested/menu1/menu1-3/index.vue b/src/views/nested/menu1/menu1-3/index.vue new file mode 100644 index 00000000..d125da8a --- /dev/null +++ b/src/views/nested/menu1/menu1-3/index.vue @@ -0,0 +1,5 @@ + diff --git a/src/views/nested/menu2/index.vue b/src/views/nested/menu2/index.vue new file mode 100644 index 00000000..aa868f06 --- /dev/null +++ b/src/views/nested/menu2/index.vue @@ -0,0 +1,5 @@ +