Skip to content

Commit 361e4fa

Browse files
author
shizhong
committed
解决处理顶级非目录路由的组件名称逻辑缺失的问题
1 parent 99a0c7c commit 361e4fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/routerHelper.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord
9393
meta.alwaysShow = true
9494
const childrenData: AppRouteRecordRaw = {
9595
path: '',
96-
name: toCamelCase(route.path, true),
96+
name:
97+
route.componentName && route.componentName.length > 0
98+
? route.componentName
99+
: toCamelCase(route.path, true),
97100
redirect: route.redirect,
98101
meta: meta
99102
}

0 commit comments

Comments
 (0)