Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
shenshaokai
jinfa-admin
Commits
08294bfa
Commit
08294bfa
authored
Aug 21, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化菜单显示
parent
a581508c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
MenuSlider.tsx
src/layouts/components/MenuSlider.tsx
+1
-1
index.tsx
src/layouts/index.tsx
+10
-2
No files found.
src/layouts/components/MenuSlider.tsx
View file @
08294bfa
...
@@ -40,7 +40,7 @@ const MenuSlider = (props) => {
...
@@ -40,7 +40,7 @@ const MenuSlider = (props) => {
const
menuUtil
=
new
MenuUtil
({
const
menuUtil
=
new
MenuUtil
({
formatMessage
,
formatMessage
,
})
})
console
.
log
(
menuData
)
console
.
log
(
selectedKeys
)
// 本地可无权限访问所有路由
// 本地可无权限访问所有路由
if
(
!
isDev
)
{
if
(
!
isDev
)
{
...
...
src/layouts/index.tsx
View file @
08294bfa
...
@@ -30,8 +30,16 @@ export const getSelectedMenuKeys = (
...
@@ -30,8 +30,16 @@ export const getSelectedMenuKeys = (
menuData
:
MenuDataItem
[],
menuData
:
MenuDataItem
[],
):
string
[]
=>
{
):
string
[]
=>
{
const
menus
=
getMatchMenu
(
pathname
,
menuData
);
const
menus
=
getMatchMenu
(
pathname
,
menuData
);
const
dispatchMenu
=
menus
.
map
(
v
=>
{
return
menus
.
map
(
item
=>
item
.
key
||
item
.
path
||
''
);
if
(
v
.
hideInMenu
)
{
const
flag
=
v
.
key
||
v
.
path
||
''
const
substr
=
flag
.
substr
(
0
,
flag
.
lastIndexOf
(
'/'
))
v
.
path
=
substr
v
.
key
=
substr
}
return
v
})
return
dispatchMenu
.
map
(
item
=>
item
.
key
||
item
.
path
||
''
);
};
};
const
Layout
=
props
=>
{
const
Layout
=
props
=>
{
...
...
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