菜单新增 alwaysShow 总是展示、componentName 组件名

This commit is contained in:
YunaiV
2023-02-10 23:03:10 +08:00
parent 877e2376be
commit 35ba9b36af
26 changed files with 923 additions and 704 deletions

View File

@@ -60,14 +60,15 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord
alwaysShow:
route.children &&
route.children.length === 1 &&
import.meta.env.VITE_ROUTE_ALWAYSSHOW_ENABLE === 'true'
? true
: false
(route.alwaysShow !== undefined ? route.alwaysShow : true)
}
// 路由地址转首字母大写驼峰作为路由名称适配keepAlive
let data: AppRouteRecordRaw = {
path: route.path,
name: toCamelCase(route.path, true),
name:
route.componentName && route.componentName.length > 0
? route.componentName
: toCamelCase(route.path, true),
redirect: route.redirect,
meta: meta
}