修复【jeecg-boot/issues/I5N2PN】左侧动态菜单怎么做国际化
parent
e036565709
commit
5b806bc70d
|
@ -7,7 +7,7 @@ import { warn } from '/@/utils/log';
|
||||||
import { createRouter, createWebHashHistory } from 'vue-router';
|
import { createRouter, createWebHashHistory } from 'vue-router';
|
||||||
import { getTenantId, getToken } from '/@/utils/auth';
|
import { getTenantId, getToken } from '/@/utils/auth';
|
||||||
import { URL_HASH_TAB } from '/@/utils';
|
import { URL_HASH_TAB } from '/@/utils';
|
||||||
import { packageViews } from '/@/utils/monorepo/dynamicRouter';
|
import {useI18n} from "/@/hooks/web/useI18n";
|
||||||
|
|
||||||
export type LayoutMapKey = 'LAYOUT';
|
export type LayoutMapKey = 'LAYOUT';
|
||||||
const IFRAME = () => import('/@/views/sys/iframe/FrameBlank.vue');
|
const IFRAME = () => import('/@/views/sys/iframe/FrameBlank.vue');
|
||||||
|
@ -31,6 +31,17 @@ function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) {
|
||||||
}
|
}
|
||||||
if (!routes) return;
|
if (!routes) return;
|
||||||
routes.forEach((item) => {
|
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:适配旧版路由选项 --------
|
// update-begin--author:sunjianlei---date:20210918---for:适配旧版路由选项 --------
|
||||||
// @ts-ignore 适配隐藏路由
|
// @ts-ignore 适配隐藏路由
|
||||||
if (item?.hidden) {
|
if (item?.hidden) {
|
||||||
|
|
Loading…
Reference in New Issue