Explorar el Código

🎈 perf:优化路由目录判断

preschooler hace 8 meses
padre
commit
e0bc260fc1
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/utils/routerHelper.ts

+ 1 - 1
src/utils/routerHelper.ts

@@ -120,7 +120,7 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord
       data.children = [childrenData]
     } else {
       // 目录
-      if (route.children) {
+      if (route.children?.length) {
         data.component = Layout
         data.redirect = getRedirect(route.path, route.children)
         // 外链