fix: LayoutMap cannot get correctly (#398)

传过来的 route.component 是小写的时候
This commit is contained in:
最后 2021-03-20 16:36:17 +08:00 committed by GitHub
parent 3520fd9465
commit 7c16c2fa9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,7 +58,8 @@ export function transformObjToRoute<T = AppRouteModule>(routeList: AppRouteModul
routeList.forEach((route) => { routeList.forEach((route) => {
if (route.component) { if (route.component) {
if ((route.component as string).toUpperCase() === 'LAYOUT') { if ((route.component as string).toUpperCase() === 'LAYOUT') {
route.component = LayoutMap.get(route.component as LayoutMapKey); //route.component = LayoutMap.get(route.component as LayoutMapKey);
route.component = LayoutMap.get((route.component as string).toUpperCase() as LayoutMapKey);
} else { } else {
route.children = [cloneDeep(route)]; route.children = [cloneDeep(route)];
route.component = LAYOUT; route.component = LAYOUT;