解决处理顶级非目录路由的组件名称逻辑缺失的问题

This commit is contained in:
shizhong 2023-09-25 15:25:33 +08:00
parent 99a0c7c3e7
commit 361e4fadda

View File

@ -93,7 +93,10 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord
meta.alwaysShow = true meta.alwaysShow = true
const childrenData: AppRouteRecordRaw = { const childrenData: AppRouteRecordRaw = {
path: '', path: '',
name: toCamelCase(route.path, true), name:
route.componentName && route.componentName.length > 0
? route.componentName
: toCamelCase(route.path, true),
redirect: route.redirect, redirect: route.redirect,
meta: meta meta: meta
} }