diff --git a/src/utils/routerHelper.ts b/src/utils/routerHelper.ts index 9da86818..f9f95c43 100644 --- a/src/utils/routerHelper.ts +++ b/src/utils/routerHelper.ts @@ -73,7 +73,7 @@ export const generateRoute = (routes: AppCustomRouteRecordRaw[]): AppRouteRecord noCache: !route.keepAlive, alwaysShow: route.children && - route.children.length === 1 && + route.children.length > 0 && (route.alwaysShow !== undefined ? route.alwaysShow : true) } as any // 特殊逻辑:如果后端配置的 MenuDO.component 包含 ?,则表示需要传递参数