From 838d5cfb6eae216898951bd49eb7dc0b2edaadcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Sun, 2 Nov 2025 22:32:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(useMetaLayoutsMenuOptions):=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E8=B7=AF=E7=94=B1=E6=A0=87=E9=A2=98=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BB=A5=E6=94=AF=E6=8C=81=E5=A4=9A=E8=AF=AD?= =?UTF-8?q?=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/useMetaLayoutsMenuOptions.tsx | 13 ++++++++++++- src/plugins/00.router-plugin.ts | 3 +-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/composables/useMetaLayoutsMenuOptions.tsx b/src/composables/useMetaLayoutsMenuOptions.tsx index e87a62a..eebbeea 100644 --- a/src/composables/useMetaLayoutsMenuOptions.tsx +++ b/src/composables/useMetaLayoutsMenuOptions.tsx @@ -19,6 +19,17 @@ export function useMetaLayoutsNMenuOptions({ menuInstRef }: { menuInstRef: Ref router.currentRoute.value, + (currentRoute) => { + const routeName = currentRoute.name; + const text = te(routeName) ? t(routeName) : routeName; + currentRoute.meta!.title = text; + }, + { immediate: true }, + ); + // 获取路由表但是不包含布局路由 const routes = createGetRoutes(router)(); @@ -113,7 +124,7 @@ export function useMetaLayoutsNMenuOptions({ menuInstRef }: { menuInstRef: Ref