chore: update nested examples.

This commit is contained in:
Bowen 2018-07-07 16:22:44 +08:00
parent cfc3db597b
commit 13df78ef01
17 changed files with 81 additions and 69 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@ dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*.log
test/unit/coverage
test/e2e/reports

View File

@ -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',

View File

@ -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' }
}
]
},

View File

@ -1,6 +1,5 @@
<template>
<div class="menu-wrapper">
<template v-if="!item.hidden&&item.children">
<div v-if="!item.hidden&&item.children" class="menu-wrapper">
<router-link v-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow" :to="resolvePath(item.children[0].path)">
<el-menu-item :index="resolvePath(item.children[0].path)" :class="{'submenu-title-noDropdown':!isNest}">
@ -27,7 +26,6 @@
</template>
</el-submenu>
</template>
</div>
</template>

View File

@ -1,6 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert title="Children: Ant" :closable="false">
</el-alert>
</div>
</template>

View File

@ -1,6 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert title="Children: Ant2" :closable="false">
</el-alert>
</div>
</template>

View File

@ -1,6 +0,0 @@
<template>
<div style="padding:30px;">
<code>Parent View: Foo</code>
<router-view></router-view>
</div>
</template>

View File

@ -1,7 +0,0 @@
<template>
<div class="app-container">
<code>Parent View: Bar</code>
<!-- <img src="https://wpimg.wallstcn.com/be29a7d2-5ccf-4a2b-888d-8a6c2bbb7aac.png"> -->
<router-view></router-view>
</div>
</template>

View File

@ -1,6 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert title="Children: Posts" type="warning" :closable="false">
</el-alert>
</div>
</template>

View File

@ -1,6 +0,0 @@
<template>
<div style="padding:30px;">
<el-alert title="Children: Profile" type="success" :closable="false">
</el-alert>
</div>
</template>

View File

@ -0,0 +1,7 @@
<template >
<div style="padding:30px;">
<el-alert title="menu 1" :closable="false">
<router-view />
</el-alert>
</div>
</template>

View File

@ -0,0 +1,7 @@
<template >
<div style="padding:30px;">
<el-alert title="menu 1-1" type="success" :closable="false">
<router-view />
</el-alert>
</div>
</template>

View File

@ -0,0 +1,7 @@
<template>
<div style="padding:30px;">
<el-alert title="menu 1-2" type="success" :closable="false">
<router-view />
</el-alert>
</div>
</template>

View File

@ -0,0 +1,5 @@
<template functional>
<div style="padding:30px;">
<el-alert title="menu 1-2-1" type="warning" :closable="false" />
</div>
</template>

View File

@ -0,0 +1,5 @@
<template functional>
<div style="padding:30px;">
<el-alert title="menu 1-2-2" type="warning" :closable="false" />
</div>
</template>

View File

@ -0,0 +1,5 @@
<template functional>
<div style="padding:30px;">
<el-alert title="menu 1-3" type="success" :closable="false" />
</div>
</template>

View File

@ -0,0 +1,5 @@
<template functional>
<div style="padding:30px;">
<el-alert title="menu 2" :closable="false" />
</div>
</template>