Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-blocks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
pro-blocks
Commits
b3af8f85
Commit
b3af8f85
authored
Feb 07, 2018
by
jim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #821 Menu selection problem
parent
5c21b990
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
.gitignore
.gitignore
+1
-0
src/components/SiderMenu/SiderMenu.js
src/components/SiderMenu/SiderMenu.js
+2
-2
No files found.
.gitignore
View file @
b3af8f85
...
...
@@ -20,3 +20,4 @@ yarn.lock
package-lock.json
*bak
jsconfig.json
.prettierrc
src/components/SiderMenu/SiderMenu.js
View file @
b3af8f85
...
...
@@ -87,12 +87,12 @@ export default class SiderMenu extends PureComponent {
}
/**
* Get selected child nodes
* /user/chen =>
/user/:id
* /user/chen =>
['user','/user/:id']
*/
getSelectedMenuKeys
=
(
path
)
=>
{
const
flatMenuKeys
=
this
.
getFlatMenuKeys
(
this
.
menus
);
return
flatMenuKeys
.
filter
((
item
)
=>
{
return
pathToRegexp
(
`/
${
item
}
`
).
test
(
path
);
return
pathToRegexp
(
`/
${
item
}
(.*)
`
).
test
(
path
);
});
}
/**
...
...
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