From b1fab04f93543643429c4a927c2505f05f9978ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=97=E5=A4=A7?= Date: Mon, 25 Mar 2024 14:33:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=8F=9C=E5=8D=95=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Application/src/search/useMenuSearch.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Application/src/search/useMenuSearch.ts b/src/components/Application/src/search/useMenuSearch.ts index 5f29c2b8b16..2efe5ee703c 100644 --- a/src/components/Application/src/search/useMenuSearch.ts +++ b/src/components/Application/src/search/useMenuSearch.ts @@ -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 { useI18n } from '@/hooks/web/useI18n'; +import { useGo } from '@/hooks/web/usePage'; import { getMenus } from '@/router/menus'; -import { cloneDeep } from 'lodash-es'; +import { type Menu } from '@/router/types'; import { filter, forEach } from '@/utils/helper/treeHelper'; -import { useGo } from '@/hooks/web/usePage'; import { useScrollTo } from '@vben/hooks'; +import { type AnyFunction } from '@vben/types'; import { onKeyStroke, useDebounceFn } from '@vueuse/core'; -import { useI18n } from '@/hooks/web/useI18n'; +import { cloneDeep } from 'lodash-es'; +import { Ref, nextTick, onBeforeMount, ref, unref } from 'vue'; export interface SearchResult { name: string; @@ -42,7 +42,7 @@ export function useMenuSearch(refs: Ref, scrollWrap: Ref, emit: A const list = await getMenus(); menuList = cloneDeep(list); forEach(menuList, (item) => { - item.name = t(item.name); + item.name = t(item.meta?.title || item.name); }); });