Browse Source

fix: LayoutMap cannot get correctly (#398)

传过来的 route.component 是小写的时候
pull/431/head
最后 6 years ago
committed by GitHub
parent
commit
7c16c2fa9e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/router/helper/routeHelper.ts

3
src/router/helper/routeHelper.ts

@ -58,7 +58,8 @@ export function transformObjToRoute<T = AppRouteModule>(routeList: AppRouteModul
routeList.forEach((route) => {
if (route.component) {
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 {
route.children = [cloneDeep(route)];
route.component = LAYOUT;

Loading…
Cancel
Save