Skip to content

Commit 9da5beb

Browse files
YunaiVgitee-org
authored andcommitted
!604 【优化】优化路由是否为目录判断条件
Merge pull request !604 from 半栈幼儿员/hotfix/router
2 parents e3a39b7 + e0bc260 commit 9da5beb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/routerHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord
120120
data.children = [childrenData]
121121
} else {
122122
// 目录
123-
if (route.children) {
123+
if (route.children?.length) {
124124
data.component = Layout
125125
data.redirect = getRedirect(route.path, route.children)
126126
// 外链

0 commit comments

Comments
 (0)