Skip to content

Commit e0bc260

Browse files
🎈 perf:优化路由目录判断
1 parent 6dc5f5d commit e0bc260

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)