Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix type #653

Merged
merged 2 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ const languages = usePreferredLanguages();
// 生成语言模块列表
const generateLangModuleMap = () => {
const fullPaths = Object.keys(langModules);
console.log(langModules, 'langModules');
fullPaths.forEach((fullPath) => {
const k = fullPath.replace('./lang', '');
const startIndex = 1;
const lastIndex = k.lastIndexOf('/');
const code = k.substring(startIndex, lastIndex);
langCode.push(code);
console.log(langCode, 'langCode');
langModuleMap.set(code, langModules[fullPath]);
});
};
Expand Down
5 changes: 3 additions & 2 deletions src/utils/route/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ function asyncImportRoute(routes: RouteItem[] | undefined) {
} else if (name) {
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
children && asyncImportRoute(children);
Expand Down Expand Up @@ -102,7 +103,7 @@ export function transformObjectToRoute<T = RouteItem>(routeList: RouteItem[]): T
}
// eslint-disable-next-line no-unused-expressions
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[];
Expand Down