Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
202f6417
Commit
202f6417
authored
Feb 09, 2018
by
baiyaaaaa
Committed by
杨奕
Feb 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Menu: support multi level submenu in horizontal mode (#9741)
parent
fe29af1b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
9 deletions
+37
-9
examples/docs/en-US/menu.md
examples/docs/en-US/menu.md
+12
-0
examples/docs/zh-CN/menu.md
examples/docs/zh-CN/menu.md
+12
-0
packages/menu/src/submenu.vue
packages/menu/src/submenu.vue
+11
-8
packages/theme-chalk/src/menu.scss
packages/theme-chalk/src/menu.scss
+2
-1
No files found.
examples/docs/en-US/menu.md
View file @
202f6417
...
...
@@ -68,6 +68,12 @@ Top bar NavMenu can be used in a variety of scenarios.
<el-menu-item
index=
"2-1"
>
item one
</el-menu-item>
<el-menu-item
index=
"2-2"
>
item two
</el-menu-item>
<el-menu-item
index=
"2-3"
>
item three
</el-menu-item>
<el-submenu
index=
"2-4"
>
<template
slot=
"title"
>
item four
</template>
<el-menu-item
index=
"2-4-1"
>
item one
</el-menu-item>
<el-menu-item
index=
"2-4-2"
>
item two
</el-menu-item>
<el-menu-item
index=
"2-4-3"
>
item three
</el-menu-item>
</el-submenu>
</el-submenu>
<el-menu-item
index=
"3"
><a
href=
"https://www.ele.me"
target=
"_blank"
>
Orders
</a></el-menu-item>
</el-menu>
...
...
@@ -86,6 +92,12 @@ Top bar NavMenu can be used in a variety of scenarios.
<el-menu-item
index=
"2-1"
>
item one
</el-menu-item>
<el-menu-item
index=
"2-2"
>
item two
</el-menu-item>
<el-menu-item
index=
"2-3"
>
item three
</el-menu-item>
<el-submenu
index=
"2-4"
>
<template
slot=
"title"
>
item four
</template>
<el-menu-item
index=
"2-4-1"
>
item one
</el-menu-item>
<el-menu-item
index=
"2-4-2"
>
item two
</el-menu-item>
<el-menu-item
index=
"2-4-3"
>
item three
</el-menu-item>
</el-submenu>
</el-submenu>
<el-menu-item
index=
"3"
><a
href=
"https://www.ele.me"
target=
"_blank"
>
Orders
</a></el-menu-item>
</el-menu>
...
...
examples/docs/zh-CN/menu.md
View file @
202f6417
...
...
@@ -69,6 +69,12 @@
<el-menu-item
index=
"2-1"
>
选项1
</el-menu-item>
<el-menu-item
index=
"2-2"
>
选项2
</el-menu-item>
<el-menu-item
index=
"2-3"
>
选项3
</el-menu-item>
<el-submenu
index=
"2-4"
>
<template
slot=
"title"
>
选项4
</template>
<el-menu-item
index=
"2-4-1"
>
选项1
</el-menu-item>
<el-menu-item
index=
"2-4-2"
>
选项2
</el-menu-item>
<el-menu-item
index=
"2-4-3"
>
选项3
</el-menu-item>
</el-submenu>
</el-submenu>
<el-menu-item
index=
"3"
><a
href=
"https://www.ele.me"
target=
"_blank"
>
订单管理
</a></el-menu-item>
</el-menu>
...
...
@@ -87,6 +93,12 @@
<el-menu-item
index=
"2-1"
>
选项1
</el-menu-item>
<el-menu-item
index=
"2-2"
>
选项2
</el-menu-item>
<el-menu-item
index=
"2-3"
>
选项3
</el-menu-item>
<el-submenu
index=
"2-4"
>
<template
slot=
"title"
>
选项4
</template>
<el-menu-item
index=
"2-4-1"
>
选项1
</el-menu-item>
<el-menu-item
index=
"2-4-2"
>
选项2
</el-menu-item>
<el-menu-item
index=
"2-4-3"
>
选项3
</el-menu-item>
</el-submenu>
</el-submenu>
<el-menu-item
index=
"3"
><a
href=
"https://www.ele.me"
target=
"_blank"
>
订单管理
</a></el-menu-item>
</el-menu>
...
...
packages/menu/src/submenu.vue
View file @
202f6417
...
...
@@ -193,7 +193,9 @@
title
&&
(
title
.
style
.
backgroundColor
=
this
.
rootMenu
.
backgroundColor
||
''
);
},
updatePlacement
()
{
this
.
currentPlacement
=
this
.
mode
===
'
horizontal
'
?
'
bottom-start
'
:
'
right-start
'
;
this
.
currentPlacement
=
this
.
mode
===
'
horizontal
'
&&
this
.
rootMenu
===
this
.
$parent
?
'
bottom-start
'
:
'
right-start
'
;
},
initPopper
()
{
this
.
referenceElm
=
this
.
$el
;
...
...
@@ -225,7 +227,8 @@
currentPlacement
,
menuTransitionName
,
mode
,
popperClass
popperClass
,
$parent
}
=
this
;
const
popupMenu
=
(
...
...
@@ -259,6 +262,11 @@
<
/el-collapse-transition
>
);
const
submenuTitleIcon
=
(
rootMenu
.
mode
===
'
horizontal
'
&&
$parent
===
rootMenu
||
rootMenu
.
mode
===
'
vertical
'
&&
!
rootMenu
.
collapse
)
?
'
el-icon-arrow-down
'
:
'
el-icon-arrow-right
'
;
return
(
<
li
class
=
{{
...
...
@@ -282,12 +290,7 @@
style
=
{[
paddingStyle
,
titleStyle
,
{
backgroundColor
}]}
>
{
$slots
.
title
}
<
i
class
=
{{
'
el-submenu__icon-arrow
'
:
true
,
'
el-icon-arrow-down
'
:
rootMenu
.
mode
===
'
horizontal
'
||
rootMenu
.
mode
===
'
vertical
'
&&
!
rootMenu
.
collapse
,
'
el-icon-arrow-right
'
:
rootMenu
.
mode
===
'
vertical
'
&&
rootMenu
.
collapse
}}
>
<
/i
>
<
i
class
=
{[
'
el-submenu__icon-arrow
'
,
submenuTitleIcon
]}
><
/i
>
<
/div
>
{
this
.
isMenuPopup
?
popupMenu
:
inlineMenu
}
<
/li
>
...
...
packages/theme-chalk/src/menu.scss
View file @
202f6417
...
...
@@ -81,7 +81,8 @@
}
}
&
.el-menu
{
&
.el-menu-item
{
&
.el-menu-item
,
&
.el-submenu__title
{
background-color
:
$--color-white
;
float
:
none
;
height
:
36px
;
...
...
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