Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄瑜
VueElementTemplate
Commits
327ed42e
Commit
327ed42e
authored
May 31, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sidebar accept Nested Routes
parent
677ef6db
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
69 additions
and
36 deletions
+69
-36
index.js
src/router/index.js
+16
-8
dragTable.vue
src/views/example/table/dragTable.vue
+0
-0
dynamictable.vue
src/views/example/table/dynamictable.vue
+0
-0
index.vue
src/views/example/table/index.vue
+3
-0
inlineEditTable.vue
src/views/example/table/inlineEditTable.vue
+0
-0
table.vue
src/views/example/table/table.vue
+0
-0
Sidebar.vue
src/views/layout/Sidebar.vue
+4
-28
SidebarItem.vue
src/views/layout/SidebarItem.vue
+46
-0
No files found.
src/router/index.js
View file @
327ed42e
...
...
@@ -51,10 +51,11 @@ const ExcelDownload = () => import('../views/excel/index');
const
Theme
=
()
=>
import
(
'../views/theme/index'
);
/* example*/
const
DynamicTable
=
()
=>
import
(
'../views/example/dynamictable'
);
const
Table
=
()
=>
import
(
'../views/example/table'
);
const
DragTable
=
()
=>
import
(
'../views/example/dragTable'
);
const
InlineEditTable
=
()
=>
import
(
'../views/example/inlineEditTable'
);
const
TableLayout
=
()
=>
import
(
'../views/example/table/index'
);
const
DynamicTable
=
()
=>
import
(
'../views/example/table/dynamictable'
);
const
Table
=
()
=>
import
(
'../views/example/table/table'
);
const
DragTable
=
()
=>
import
(
'../views/example/table/dragTable'
);
const
InlineEditTable
=
()
=>
import
(
'../views/example/table/inlineEditTable'
);
const
Form1
=
()
=>
import
(
'../views/example/form1'
);
/* permission */
...
...
@@ -192,10 +193,17 @@ export const asyncRouterMap = [
name
:
'综合实例'
,
icon
:
'zonghe'
,
children
:
[
{
path
:
'dynamictable'
,
component
:
DynamicTable
,
name
:
'动态table'
},
{
path
:
'dragtable'
,
component
:
DragTable
,
name
:
'拖拽table'
},
{
path
:
'inline_edit_table'
,
component
:
InlineEditTable
,
name
:
'table内编辑'
},
{
path
:
'table'
,
component
:
Table
,
name
:
'综合table'
},
{
path
:
'/table'
,
component
:
TableLayout
,
name
:
'table'
,
children
:
[
{
path
:
'dynamictable'
,
component
:
DynamicTable
,
name
:
'动态table'
},
{
path
:
'dragtable'
,
component
:
DragTable
,
name
:
'拖拽table'
},
{
path
:
'inline_edit_table'
,
component
:
InlineEditTable
,
name
:
'table内编辑'
},
{
path
:
'table'
,
component
:
Table
,
name
:
'综合table'
}
]
},
{
path
:
'form1'
,
component
:
Form1
,
name
:
'综合form1'
}
]
},
...
...
src/views/example/dragTable.vue
→
src/views/example/
table/
dragTable.vue
View file @
327ed42e
File moved
src/views/example/dynamictable.vue
→
src/views/example/
table/
dynamictable.vue
View file @
327ed42e
File moved
src/views/example/table/index.vue
0 → 100644
View file @
327ed42e
<
template
>
<router-view></router-view>
</
template
>
src/views/example/inlineEditTable.vue
→
src/views/example/
table/
inlineEditTable.vue
View file @
327ed42e
File moved
src/views/example/table.vue
→
src/views/example/table
/table
.vue
View file @
327ed42e
File moved
src/views/layout/Sidebar.vue
View file @
327ed42e
<
template
>
<el-menu
:unique-opened=
'true'
mode=
"vertical"
theme=
"dark"
:default-active=
"$route.path"
>
<template
v-for=
"item in permission_routers"
v-if=
"!item.hidden"
>
<el-submenu
:index=
"item.name"
v-if=
"!item.noDropdown"
>
<template
slot=
"title"
>
<wscn-icon-svg
:icon-class=
"item.icon||'wenzhang1'"
/>
{{
item
.
name
}}
</
template
>
<router-link
v-for=
"child in item.children"
:key=
"child.path"
v-if=
"!child.hidden"
class=
"title-link"
:to=
"item.path+'/'+child.path"
>
<el-menu-item
:index=
"item.path+'/'+child.path"
>
{{child.name}}
</el-menu-item>
</router-link>
</el-submenu>
<router-link
v-if=
"item.noDropdown&&item.children.length>0"
:to=
"item.path+'/'+item.children[0].path"
>
<el-menu-item
:index=
"item.path+'/'+item.children[0].path"
>
<wscn-icon-svg
:icon-class=
"item.icon||'geren1'"
/>
{{item.children[0].name}}
</el-menu-item>
</router-link>
</template>
<el-menu
mode=
"vertical"
theme=
"dark"
:default-active=
"$route.path"
>
<sidebar-item
:routes=
'permission_routers'
></sidebar-item>
</el-menu>
</
template
>
<
script
>
import
{
mapGetters
}
from
'vuex'
;
import
SidebarItem
from
'./SidebarItem'
;
export
default
{
name
:
'Sidebar'
,
components
:{
SidebarItem
}
,
computed
:
{
...
mapGetters
([
'permission_routers'
...
...
@@ -32,16 +16,8 @@
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
.el-menu
{
min-height
:
100%
;
}
.wscn-icon
{
margin-right
:
10px
;
}
.hideSidebar
.title-link
{
display
:
block
;
text-indent
:
10px
;
}
</
style
>
src/views/layout/SidebarItem.vue
0 → 100644
View file @
327ed42e
<
template
>
<div>
<template
v-for=
"item in routes"
>
<router-link
v-if=
"!item.hidden&&item.noDropdown&&item.children.length>0"
:to=
"item.path+'/'+item.children[0].path"
>
<el-menu-item
:index=
"item.path+'/'+item.children[0].path"
>
<wscn-icon-svg
v-if=
'item.icon'
:icon-class=
"item.icon"
/>
{{
item
.
children
[
0
].
name
}}
</el-menu-item>
</router-link>
<el-submenu
:index=
"item.name"
v-if=
"!item.noDropdown&&!item.hidden"
>
<template
slot=
"title"
>
<wscn-icon-svg
v-if=
'item.icon'
:icon-class=
"item.icon"
/>
{{
item
.
name
}}
</
template
>
<
template
v-for=
"child in item.children"
v-if=
'!child.hidden'
>
<sidebar-item
class=
'menu-indent'
v-if=
'child.children&&child.children.length>0'
:routes=
'[child]'
>
</sidebar-item>
<router-link
v-else
class=
"menu-indent"
:to=
"item.path+'/'+child.path"
>
<el-menu-item
:index=
"item.path+'/'+child.path"
>
{{
child
.
name
}}
</el-menu-item>
</router-link>
</
template
>
</el-submenu>
</template>
</div>
</template>
<
script
>
export
default
{
name
:
'SidebarItem'
,
props
:
{
routes
:
{
type
:
Array
}
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
.wscn-icon
{
margin-right
:
10px
;
}
.hideSidebar
.menu-indent
{
display
:
block
;
text-indent
:
10px
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment