fix: ts error (#652)

This commit is contained in:
PY 2023-12-05 11:48:40 +08:00 committed by GitHub
parent c650fb7ace
commit 3fbee5a9cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -92,4 +92,4 @@
"engines": {
"node": ">=16.0.0"
}
}
}

View File

@ -51,7 +51,7 @@ function asyncImportRoute(routes: RouteItem[] | undefined) {
} else if (name) {
item.component = PARENT_LAYOUT();
}
if (item.meta.icon) item.meta.icon = await getMenuIcon(item.meta.icon);
if (item.meta.icon) item.meta.icon = (await getMenuIcon(item.meta.icon)).value;
// eslint-disable-next-line no-unused-expressions
children && asyncImportRoute(children);
@ -102,7 +102,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);
if (route.meta.icon) route.meta.icon = (await getMenuIcon(route.meta.icon)).value;
});
return [PAGE_NOT_FOUND_ROUTE, ...routeList] as unknown as T[];