perf: 路由子集显示可配置

This commit is contained in:
xingyu
2022-12-20 16:05:16 +08:00
parent ec0bb01e07
commit 1ef6016d9d
4 changed files with 12 additions and 3 deletions

View File

@ -57,7 +57,12 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord
icon: route.icon,
hidden: !route.visible,
noCache: !route.keepAlive,
alwaysShow: route.children && route.children.length == 1 ? true : false
alwaysShow:
route.children &&
route.children.length === 1 &&
import.meta.env.VITE_ROUTE_ALWAYSSHOW_ENABLE === 'true'
? true
: false
}
// 路由地址转首字母大写驼峰作为路由名称适配keepAlive
let data: AppRouteRecordRaw = {