ソースを参照

fix: LayoutMap cannot get correctly (#398)

传过来的 route.component 是小写的时候
最后 4 年 前
コミット
7c16c2fa9e
1 ファイル変更2 行追加1 行削除
  1. 2 1
      src/router/helper/routeHelper.ts

+ 2 - 1
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;