From b88f042d208b564a55a6bdff3bf5c20b0372bc88 Mon Sep 17 00:00:00 2001 From: xingyu Date: Tue, 20 Dec 2022 15:49:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BD=93=E5=8F=AA=E6=9C=89=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=AD=90=E8=8F=9C=E5=8D=95=E6=97=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=88=B6=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-admin-vue3/src/utils/routerHelper.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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),