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
48009e21
Commit
48009e21
authored
Dec 25, 2016
by
Howard.Zuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ElMenu]: active menuitem which matches user specfied route
parent
775d5c16
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
packages/menu/src/menu.vue
packages/menu/src/menu.vue
+8
-0
No files found.
packages/menu/src/menu.vue
View file @
48009e21
...
...
@@ -107,6 +107,14 @@
},
openActiveItemMenus
()
{
let
index
=
this
.
activeIndex
;
// 选中用户指定的路由对应的menu
if
(
this
.
router
)
{
const
userSpecifiedIndexs
=
Object
.
keys
(
this
.
menuItems
)
.
filter
(
k
=>
this
.
menuItems
[
k
].
route
)
.
filter
(
k
=>
this
.
menuItems
[
k
].
route
.
path
===
this
.
$route
.
path
);
userSpecifiedIndexs
.
length
&&
(
index
=
this
.
activeIndex
=
userSpecifiedIndexs
[
0
]);
}
if
(
!
this
.
menuItems
[
index
])
return
;
if
(
index
&&
this
.
mode
===
'
vertical
'
)
{
let
indexPath
=
this
.
menuItems
[
index
].
indexPath
;
...
...
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