mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-24 02:00:25 +08:00
fix: 菜单搜索功能修复 (#3688)
This commit is contained in:
parent
7c52f083db
commit
c1809cd6c5
@ -1,13 +1,13 @@
|
|||||||
import { type Menu } from '@/router/types';
|
|
||||||
import { type AnyFunction } from '@vben/types';
|
|
||||||
import { ref, onBeforeMount, unref, Ref, nextTick } from 'vue';
|
|
||||||
import { getMenus } from '@/router/menus';
|
|
||||||
import { cloneDeep } from 'lodash-es';
|
|
||||||
import { filter, forEach } from '@/utils/helper/treeHelper';
|
|
||||||
import { useGo } from '@/hooks/web/usePage';
|
|
||||||
import { useScrollTo } from '@vben/hooks';
|
|
||||||
import { onKeyStroke, useDebounceFn } from '@vueuse/core';
|
|
||||||
import { useI18n } from '@/hooks/web/useI18n';
|
import { useI18n } from '@/hooks/web/useI18n';
|
||||||
|
import { useGo } from '@/hooks/web/usePage';
|
||||||
|
import { getMenus } from '@/router/menus';
|
||||||
|
import { type Menu } from '@/router/types';
|
||||||
|
import { filter, forEach } from '@/utils/helper/treeHelper';
|
||||||
|
import { useScrollTo } from '@vben/hooks';
|
||||||
|
import { type AnyFunction } from '@vben/types';
|
||||||
|
import { onKeyStroke, useDebounceFn } from '@vueuse/core';
|
||||||
|
import { cloneDeep } from 'lodash-es';
|
||||||
|
import { Ref, nextTick, onBeforeMount, ref, unref } from 'vue';
|
||||||
|
|
||||||
export interface SearchResult {
|
export interface SearchResult {
|
||||||
name: string;
|
name: string;
|
||||||
@ -42,7 +42,7 @@ export function useMenuSearch(refs: Ref<HTMLElement[]>, scrollWrap: Ref, emit: A
|
|||||||
const list = await getMenus();
|
const list = await getMenus();
|
||||||
menuList = cloneDeep(list);
|
menuList = cloneDeep(list);
|
||||||
forEach(menuList, (item) => {
|
forEach(menuList, (item) => {
|
||||||
item.name = t(item.name);
|
item.name = t(item.meta?.title || item.name);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user