Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
najiu-frontend
najiu-admin-template
Commits
02d3dca5
Commit
02d3dca5
authored
Jul 05, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(app-search): exclude items by `hideChildrenInMenu`
修复菜单搜索组件可能会显示被隐藏的子菜单的问题
parent
faf5c9fd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
useMenuSearch.ts
src/components/Application/src/search/useMenuSearch.ts
+3
-3
about.ts
src/router/routes/modules/about.ts
+1
-0
No files found.
src/components/Application/src/search/useMenuSearch.ts
View file @
02d3dca5
...
@@ -64,15 +64,15 @@ export function useMenuSearch(refs: Ref<HTMLElement[]>, scrollWrap: Ref<ElRef>,
...
@@ -64,15 +64,15 @@ export function useMenuSearch(refs: Ref<HTMLElement[]>, scrollWrap: Ref<ElRef>,
function
handlerSearchResult
(
filterMenu
:
Menu
[],
reg
:
RegExp
,
parent
?:
Menu
)
{
function
handlerSearchResult
(
filterMenu
:
Menu
[],
reg
:
RegExp
,
parent
?:
Menu
)
{
const
ret
:
SearchResult
[]
=
[];
const
ret
:
SearchResult
[]
=
[];
filterMenu
.
forEach
((
item
)
=>
{
filterMenu
.
forEach
((
item
)
=>
{
const
{
name
,
path
,
icon
,
children
,
hideMenu
}
=
item
;
const
{
name
,
path
,
icon
,
children
,
hideMenu
,
meta
}
=
item
;
if
(
!
hideMenu
&&
reg
.
test
(
name
)
&&
!
children
?.
length
)
{
if
(
!
hideMenu
&&
reg
.
test
(
name
)
&&
(
!
children
?.
length
||
meta
?.
hideChildrenInMenu
)
)
{
ret
.
push
({
ret
.
push
({
name
:
parent
?.
name
?
`
${
parent
.
name
}
>
${
name
}
`
:
name
,
name
:
parent
?.
name
?
`
${
parent
.
name
}
>
${
name
}
`
:
name
,
path
,
path
,
icon
,
icon
,
});
});
}
}
if
(
Array
.
isArray
(
children
)
&&
children
.
length
)
{
if
(
!
meta
?.
hideChildrenInMenu
&&
Array
.
isArray
(
children
)
&&
children
.
length
)
{
ret
.
push
(...
handlerSearchResult
(
children
,
reg
,
item
));
ret
.
push
(...
handlerSearchResult
(
children
,
reg
,
item
));
}
}
});
});
...
...
src/router/routes/modules/about.ts
View file @
02d3dca5
...
@@ -22,6 +22,7 @@ const dashboard: AppRouteModule = {
...
@@ -22,6 +22,7 @@ const dashboard: AppRouteModule = {
meta
:
{
meta
:
{
title
:
t
(
'
routes.dashboard.about
'
),
title
:
t
(
'
routes.dashboard.about
'
),
icon
:
'
simple-icons:about-dot-me
'
,
icon
:
'
simple-icons:about-dot-me
'
,
// hideMenu: true,
},
},
},
},
],
],
...
...
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