From 5b806bc70d2cac6f198351ccd210988da4203e08 Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Sun, 9 Oct 2022 17:16:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=90jeecg-boot/issues/I5?= =?UTF-8?q?N2PN=E3=80=91=E5=B7=A6=E4=BE=A7=E5=8A=A8=E6=80=81=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=80=8E=E4=B9=88=E5=81=9A=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/helper/routeHelper.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/router/helper/routeHelper.ts b/src/router/helper/routeHelper.ts index 99b6b1a..9ffa694 100644 --- a/src/router/helper/routeHelper.ts +++ b/src/router/helper/routeHelper.ts @@ -7,7 +7,7 @@ import { warn } from '/@/utils/log'; import { createRouter, createWebHashHistory } from 'vue-router'; import { getTenantId, getToken } from '/@/utils/auth'; import { URL_HASH_TAB } from '/@/utils'; -import { packageViews } from '/@/utils/monorepo/dynamicRouter'; +import {useI18n} from "/@/hooks/web/useI18n"; export type LayoutMapKey = 'LAYOUT'; const IFRAME = () => import('/@/views/sys/iframe/FrameBlank.vue'); @@ -31,6 +31,17 @@ function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) { } if (!routes) return; routes.forEach((item) => { + + //【jeecg-boot/issues/I5N2PN】左侧动态菜单怎么做国际化处理 2022-10-09 + //菜单支持国际化翻译 + if (item?.meta?.title) { + const { t } = useI18n(); + if(item.meta.title.includes('t(\'') && t){ + item.meta.title = eval(item.meta.title); + //console.log('译后: ',item.meta.title) + } + } + // update-begin--author:sunjianlei---date:20210918---for:适配旧版路由选项 -------- // @ts-ignore 适配隐藏路由 if (item?.hidden) {