From e87c46ad0ab369786a321ef32950f7e8bd78f8b4 Mon Sep 17 00:00:00 2001 From: Hooray <304327508@qq.com> Date: Sat, 22 Feb 2025 11:13:30 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E8=B7=AF=E7=94=B1=E4=B8=AD=E9=97=B4=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=BB=84=E4=BB=B6=E7=9A=84=E8=BE=B9=E7=95=8C?= =?UTF-8?q?=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/route.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/store/modules/route.ts b/src/store/modules/route.ts index dc29926d..bdebb39c 100755 --- a/src/store/modules/route.ts +++ b/src/store/modules/route.ts @@ -63,10 +63,13 @@ const useRouteStore = defineStore( function deleteMiddleRouteComponent(routes: RouteRecordRaw[]) { const res: RouteRecordRaw[] = [] routes.forEach((route) => { - if (route.children) { + if (route.children?.length) { delete route.component route.children = deleteMiddleRouteComponent(route.children) } + else { + delete route.children + } res.push(route) }) return res