diff --git a/yudao-ui-admin-vue3/src/utils/routerHelper.ts b/yudao-ui-admin-vue3/src/utils/routerHelper.ts index 996406104..02a738da8 100644 --- a/yudao-ui-admin-vue3/src/utils/routerHelper.ts +++ b/yudao-ui-admin-vue3/src/utils/routerHelper.ts @@ -56,7 +56,8 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord title: route.name, icon: route.icon, hidden: !route.visible, - noCache: !route.keepAlive + noCache: !route.keepAlive, + alwaysShow: route.children && route.children.length == 1 ? true : false } // 路由地址转首字母大写驼峰,作为路由名称,适配keepAlive let data: AppRouteRecordRaw = { @@ -71,6 +72,7 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord data.meta = {} data.name = toCamelCase(route.path, true) + 'Parent' data.redirect = '' + meta.alwaysShow = true const childrenData: AppRouteRecordRaw = { path: '', name: toCamelCase(route.path, true),