From ee8fa04814c1566b33d6068799805815c93de85f Mon Sep 17 00:00:00 2001 From: cc Date: Thu, 25 May 2023 21:05:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(projects):=20=E4=BF=AE=E5=A4=8D=E9=9D=A2?= =?UTF-8?q?=E5=8C=85=E5=B1=91=E5=AF=BC=E8=88=AA=E4=B8=8B=E6=8B=89=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E8=AF=AD=E8=A8=80=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global-header/components/global-breadcrumb.vue | 12 +++++++++--- src/typings/system.d.ts | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/layouts/common/global-header/components/global-breadcrumb.vue b/src/layouts/common/global-header/components/global-breadcrumb.vue index 8256ef71..b59c5d1a 100644 --- a/src/layouts/common/global-header/components/global-breadcrumb.vue +++ b/src/layouts/common/global-header/components/global-breadcrumb.vue @@ -9,7 +9,7 @@ v-if="theme.header.crumb.showIcon" class="inline-block align-text-bottom mr-4px text-16px" /> - {{ breadcrumb.i18nTitle ? t(breadcrumb.i18nTitle) : breadcrumb.label }} + {{ breadcrumb.label }} @@ -45,7 +45,13 @@ const routeStore = useRouteStore(); const { routerPush } = useRouterPush(); const breadcrumbs = computed(() => - getBreadcrumbByRouteKey(route.name as string, routeStore.menus as App.GlobalMenuOption[], routePath('root')) + getBreadcrumbByRouteKey(route.name as string, routeStore.menus as App.GlobalMenuOption[], routePath('root')).map( + item => ({ + ...item, + label: item.i18nTitle ? t(item.i18nTitle) : item.label, + options: item.options?.map(oItem => ({ ...oItem, label: oItem.i18nTitle ? t(oItem.i18nTitle) : oItem.label })) + }) + ) ); function dropdownSelect(key: string) { diff --git a/src/typings/system.d.ts b/src/typings/system.d.ts index 5ef41072..c47f6ccd 100644 --- a/src/typings/system.d.ts +++ b/src/typings/system.d.ts @@ -254,7 +254,7 @@ declare namespace App { hasChildren: boolean; icon?: import('vue').Component; i18nTitle?: string; - options?: import('naive-ui/es/dropdown/src/interface').DropdownMixedOption[]; + options?: (import('naive-ui/es/dropdown/src/interface').DropdownMixedOption & { i18nTitle?: string })[]; }; /** 多页签Tab的路由 */