Browse Source

!604 【优化】优化路由是否为目录判断条件
Merge pull request !604 from 半栈幼儿员/hotfix/router

芋道源码 8 months ago
parent
commit
9da5beb879
1 changed files with 1 additions and 1 deletions
  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]
       data.children = [childrenData]
     } else {
     } else {
       // 目录
       // 目录
-      if (route.children) {
+      if (route.children?.length) {
         data.component = Layout
         data.component = Layout
         data.redirect = getRedirect(route.path, route.children)
         data.redirect = getRedirect(route.path, route.children)
         // 外链
         // 外链