mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-09-21 11:14:22 +08:00
parent
6a53559aa3
commit
b5400ed02a
|
@ -18,14 +18,12 @@ const languages = usePreferredLanguages();
|
||||||
// 生成语言模块列表
|
// 生成语言模块列表
|
||||||
const generateLangModuleMap = () => {
|
const generateLangModuleMap = () => {
|
||||||
const fullPaths = Object.keys(langModules);
|
const fullPaths = Object.keys(langModules);
|
||||||
console.log(langModules, 'langModules');
|
|
||||||
fullPaths.forEach((fullPath) => {
|
fullPaths.forEach((fullPath) => {
|
||||||
const k = fullPath.replace('./lang', '');
|
const k = fullPath.replace('./lang', '');
|
||||||
const startIndex = 1;
|
const startIndex = 1;
|
||||||
const lastIndex = k.lastIndexOf('/');
|
const lastIndex = k.lastIndexOf('/');
|
||||||
const code = k.substring(startIndex, lastIndex);
|
const code = k.substring(startIndex, lastIndex);
|
||||||
langCode.push(code);
|
langCode.push(code);
|
||||||
console.log(langCode, 'langCode');
|
|
||||||
langModuleMap.set(code, langModules[fullPath]);
|
langModuleMap.set(code, langModules[fullPath]);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -51,7 +51,8 @@ function asyncImportRoute(routes: RouteItem[] | undefined) {
|
||||||
} else if (name) {
|
} else if (name) {
|
||||||
item.component = PARENT_LAYOUT();
|
item.component = PARENT_LAYOUT();
|
||||||
}
|
}
|
||||||
if (item.meta.icon) item.meta.icon = (await getMenuIcon(item.meta.icon)).value;
|
|
||||||
|
if (item.meta.icon) item.meta.icon = await getMenuIcon(item.meta.icon);
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-expressions
|
// eslint-disable-next-line no-unused-expressions
|
||||||
children && asyncImportRoute(children);
|
children && asyncImportRoute(children);
|
||||||
|
@ -102,7 +103,7 @@ export function transformObjectToRoute<T = RouteItem>(routeList: RouteItem[]): T
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line no-unused-expressions
|
// eslint-disable-next-line no-unused-expressions
|
||||||
route.children && asyncImportRoute(route.children);
|
route.children && asyncImportRoute(route.children);
|
||||||
if (route.meta.icon) route.meta.icon = (await getMenuIcon(route.meta.icon)).value;
|
if (route.meta.icon) route.meta.icon = await getMenuIcon(route.meta.icon);
|
||||||
});
|
});
|
||||||
|
|
||||||
return [PAGE_NOT_FOUND_ROUTE, ...routeList] as unknown as T[];
|
return [PAGE_NOT_FOUND_ROUTE, ...routeList] as unknown as T[];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user