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
9ba26486
Commit
9ba26486
authored
Jan 03, 2018
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix[sidebar]: fixed nest menu and noDropdown item bug
parent
1d0b26ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
SidebarItem.vue
src/views/layout/components/Sidebar/SidebarItem.vue
+6
-2
No files found.
src/views/layout/components/Sidebar/SidebarItem.vue
View file @
9ba26486
...
...
@@ -3,7 +3,7 @@
<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"
>
<el-menu-item
:index=
"item.path+'/'+item.children[0].path"
class=
'submenu-title-noDropdown'
>
<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>
<span
v-if=
"item.children[0].meta&&item.children[0].meta.title"
>
{{
generateTitle
(
item
.
children
[
0
].
meta
.
title
)
}}
</span>
</el-menu-item>
...
...
@@ -16,7 +16,7 @@
</
template
>
<
template
v-for=
"child in item.children"
v-if=
"!child.hidden"
>
<sidebar-item
class=
"nest-menu"
v-if=
"child.children&&child.children.length>0"
:routes=
"[child]"
:key=
"child.path"
></sidebar-item>
<sidebar-item
:is-nest=
"true"
class=
"nest-menu"
v-if=
"child.children&&child.children.length>0"
:routes=
"[child]"
:key=
"child.path"
></sidebar-item>
<router-link
v-else
:to=
"item.path+'/'+child.path"
:key=
"child.name"
>
<el-menu-item
:index=
"item.path+'/'+child.path"
>
...
...
@@ -39,6 +39,10 @@ export default {
props
:
{
routes
:
{
type
:
Array
},
isNest
:
{
type
:
Boolean
,
default
:
false
}
},
methods
:
{
...
...
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