mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2026-01-13 20:57:09 +08:00
fix: 修复菜单快捷搜索问题 (#67)
This commit is contained in:
@@ -107,15 +107,14 @@ const searchRoutes = (keyword: string) => {
|
||||
const result: SearchResult[] = []
|
||||
const loop = (routes: RouteRecordRaw[]) => {
|
||||
routes.forEach((route) => {
|
||||
if (route.meta?.title?.toLowerCase().includes(keyword.toLowerCase()) && !route.meta?.hidden) {
|
||||
result.push({
|
||||
title: route.meta.title,
|
||||
path: route.path,
|
||||
})
|
||||
}
|
||||
if (route.children && route.children.length > 0) {
|
||||
loop(route.children)
|
||||
} else {
|
||||
if (route.meta?.title?.toLowerCase().includes(keyword.toLowerCase())) {
|
||||
result.push({
|
||||
title: route.meta.title,
|
||||
path: route.path,
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user