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
faf5c9fd
Commit
faf5c9fd
authored
Jul 05, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(app-search): exclude hidden items
修复菜单搜索组件可能会显示被隐藏的菜单的问题
parent
d5d5c4b4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+1
-0
useMenuSearch.ts
src/components/Application/src/search/useMenuSearch.ts
+3
-3
setup.ts
src/router/routes/modules/demo/setup.ts
+1
-1
No files found.
CHANGELOG.zh_CN.md
View file @
faf5c9fd
### 🐛 Bug Fixes
### 🐛 Bug Fixes
-
**Table**
修复滚动条样式问题
-
**Table**
修复滚动条样式问题
-
**AppSearch**
修复可能会搜索隐藏菜单的问题
-
**其它**
修复菜单默认折叠的配置不起作用的问题
-
**其它**
修复菜单默认折叠的配置不起作用的问题
## 2.6.0(2021-07-04)
## 2.6.0(2021-07-04)
...
...
src/components/Application/src/search/useMenuSearch.ts
View file @
faf5c9fd
...
@@ -55,7 +55,7 @@ export function useMenuSearch(refs: Ref<HTMLElement[]>, scrollWrap: Ref<ElRef>,
...
@@ -55,7 +55,7 @@ export function useMenuSearch(refs: Ref<HTMLElement[]>, scrollWrap: Ref<ElRef>,
}
}
const
reg
=
createSearchReg
(
unref
(
keyword
));
const
reg
=
createSearchReg
(
unref
(
keyword
));
const
filterMenu
=
filter
(
menuList
,
(
item
)
=>
{
const
filterMenu
=
filter
(
menuList
,
(
item
)
=>
{
return
reg
.
test
(
item
.
name
);
return
reg
.
test
(
item
.
name
)
&&
!
item
.
hideMenu
;
});
});
searchResult
.
value
=
handlerSearchResult
(
filterMenu
,
reg
);
searchResult
.
value
=
handlerSearchResult
(
filterMenu
,
reg
);
activeIndex
.
value
=
0
;
activeIndex
.
value
=
0
;
...
@@ -64,8 +64,8 @@ export function useMenuSearch(refs: Ref<HTMLElement[]>, scrollWrap: Ref<ElRef>,
...
@@ -64,8 +64,8 @@ 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
}
=
item
;
const
{
name
,
path
,
icon
,
children
,
hideMenu
}
=
item
;
if
(
reg
.
test
(
name
)
&&
!
children
?.
length
)
{
if
(
!
hideMenu
&&
reg
.
test
(
name
)
&&
!
children
?.
length
)
{
ret
.
push
({
ret
.
push
({
name
:
parent
?.
name
?
`
${
parent
.
name
}
>
${
name
}
`
:
name
,
name
:
parent
?.
name
?
`
${
parent
.
name
}
>
${
name
}
`
:
name
,
path
,
path
,
...
...
src/router/routes/modules/demo/setup.ts
View file @
faf5c9fd
...
@@ -11,7 +11,7 @@ const setup: AppRouteModule = {
...
@@ -11,7 +11,7 @@ const setup: AppRouteModule = {
meta
:
{
meta
:
{
orderNo
:
90000
,
orderNo
:
90000
,
hideChildrenInMenu
:
true
,
hideChildrenInMenu
:
true
,
icon
:
'
simple-icons:about-dot-me
'
,
icon
:
'
whh:paintroll
'
,
title
:
t
(
'
routes.demo.setup.page
'
),
title
:
t
(
'
routes.demo.setup.page
'
),
},
},
children
:
[
children
:
[
...
...
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