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
6f2a7ce8
Commit
6f2a7ce8
authored
Jan 24, 2018
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat[menu]: add alwaysShow option
parent
2e0d3fd0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
13 deletions
+20
-13
en.js
src/lang/en.js
+2
-1
zh.js
src/lang/zh.js
+11
-10
index.js
src/router/index.js
+6
-1
SidebarItem.vue
src/views/layout/components/Sidebar/SidebarItem.vue
+1
-1
No files found.
src/lang/en.js
View file @
6f2a7ce8
...
@@ -42,7 +42,8 @@ export default {
...
@@ -42,7 +42,8 @@ export default {
exportExcel
:
'Export Excel'
,
exportExcel
:
'Export Excel'
,
selectExcel
:
'Export Selected'
,
selectExcel
:
'Export Selected'
,
uploadExcel
:
'Upload Excel'
,
uploadExcel
:
'Upload Excel'
,
exportZip
:
'Zip'
,
zip
:
'Zip'
,
exportZip
:
'Export Zip'
,
theme
:
'Theme'
,
theme
:
'Theme'
,
clipboardDemo
:
'Clipboard'
,
clipboardDemo
:
'Clipboard'
,
i18n
:
'I18n'
i18n
:
'I18n'
...
...
src/lang/zh.js
View file @
6f2a7ce8
...
@@ -24,10 +24,10 @@ export default {
...
@@ -24,10 +24,10 @@ export default {
mixChart
:
'混合图表'
,
mixChart
:
'混合图表'
,
example
:
'综合实例'
,
example
:
'综合实例'
,
Table
:
'Table'
,
Table
:
'Table'
,
dynamicTable
:
'动态
t
able'
,
dynamicTable
:
'动态
T
able'
,
dragTable
:
'拖拽
t
able'
,
dragTable
:
'拖拽
T
able'
,
inlineEditTable
:
'
t
able内编辑'
,
inlineEditTable
:
'
T
able内编辑'
,
complexTable
:
'综合
t
able'
,
complexTable
:
'综合
T
able'
,
treeTable
:
'树形表格'
,
treeTable
:
'树形表格'
,
customTreeTable
:
'自定义树表'
,
customTreeTable
:
'自定义树表'
,
tab
:
'Tab'
,
tab
:
'Tab'
,
...
@@ -38,13 +38,14 @@ export default {
...
@@ -38,13 +38,14 @@ export default {
page401
:
'401'
,
page401
:
'401'
,
page404
:
'404'
,
page404
:
'404'
,
errorLog
:
'错误日志'
,
errorLog
:
'错误日志'
,
excel
:
'excel'
,
excel
:
'Excel'
,
exportExcel
:
'export excel'
,
exportExcel
:
'Export Excel'
,
selectExcel
:
'export selected'
,
selectExcel
:
'Export Selected'
,
uploadExcel
:
'upload excel'
,
uploadExcel
:
'Upload Excel'
,
exportZip
:
'zip'
,
zip
:
'Zip'
,
exportZip
:
'Export Zip'
,
theme
:
'换肤'
,
theme
:
'换肤'
,
clipboardDemo
:
'
c
lipboard'
,
clipboardDemo
:
'
C
lipboard'
,
i18n
:
'国际化'
i18n
:
'国际化'
},
},
navbar
:
{
navbar
:
{
...
...
src/router/index.js
View file @
6f2a7ce8
...
@@ -15,6 +15,9 @@ import Layout from '../views/layout/Layout'
...
@@ -15,6 +15,9 @@ import Layout from '../views/layout/Layout'
/**
/**
* hidden: true if `hidden:true` will not show in the sidebar(default is false)
* hidden: true if `hidden:true` will not show in the sidebar(default is false)
* alwaysShow: true if set true, will always show the root menu, whatever its child routes length
* if not set alwaysShow, only more than one route under the children
* it will becomes nested mode, otherwise not show the root menu
* redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb
* redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : {
* meta : {
...
@@ -217,7 +220,9 @@ export const asyncRouterMap = [
...
@@ -217,7 +220,9 @@ export const asyncRouterMap = [
path
:
'/zip'
,
path
:
'/zip'
,
component
:
Layout
,
component
:
Layout
,
redirect
:
'/zip/download'
,
redirect
:
'/zip/download'
,
children
:
[{
path
:
'download'
,
component
:
_import
(
'zip/index'
),
name
:
'exportZip'
,
meta
:
{
title
:
'exportZip'
,
icon
:
'zip'
}}]
alwaysShow
:
true
,
meta
:
{
title
:
'zip'
,
icon
:
'zip'
},
children
:
[{
path
:
'download'
,
component
:
_import
(
'zip/index'
),
name
:
'exportZip'
,
meta
:
{
title
:
'exportZip'
}}]
},
},
{
{
...
...
src/views/layout/components/Sidebar/SidebarItem.vue
View file @
6f2a7ce8
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"menu-wrapper"
>
<div
class=
"menu-wrapper"
>
<template
v-for=
"item in routes"
v-if=
"!item.hidden&&item.children"
>
<template
v-for=
"item in routes"
v-if=
"!item.hidden&&item.children"
>
<router-link
v-if=
"item.children.length===1 && !item.children[0].children"
:to=
"item.path+'/'+item.children[0].path"
:key=
"item.children[0].name"
>
<router-link
v-if=
"item.children.length===1 && !item.children[0].children
&&!item.alwaysShow
"
:to=
"item.path+'/'+item.children[0].path"
:key=
"item.children[0].name"
>
<el-menu-item
:index=
"item.path+'/'+item.children[0].path"
:class=
"
{'submenu-title-noDropdown':!isNest}">
<el-menu-item
:index=
"item.path+'/'+item.children[0].path"
:class=
"
{'submenu-title-noDropdown':!isNest}">
<svg-icon
v-if=
"item.children[0].meta&&item.children[0].meta.icon"
:icon-class=
"item.children[0].meta.icon"
></svg-icon>
<svg-icon
v-if=
"item.children[0].meta&&item.children[0].meta.icon"
:icon-class=
"item.children[0].meta.icon"
></svg-icon>
<span
v-if=
"item.children[0].meta&&item.children[0].meta.title"
>
{{
generateTitle
(
item
.
children
[
0
].
meta
.
title
)
}}
</span>
<span
v-if=
"item.children[0].meta&&item.children[0].meta.title"
>
{{
generateTitle
(
item
.
children
[
0
].
meta
.
title
)
}}
</span>
...
...
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