fix: 修复resetRouter未清空全部路由数据 (#1208)

This commit is contained in:
tinyThing
2025-04-21 12:29:38 +08:00
committed by GitHub
parent 59319aac8b
commit 8255f9063b
2 changed files with 21 additions and 14 deletions

View File

@@ -172,6 +172,8 @@ function handleAsyncRoutes(routeList) {
const flattenRouters: any = router
.getRoutes()
.find(n => n.path === "/");
// 保持router.options.routes[0].children与path为"/"的children一致防止数据不一致导致异常
flattenRouters.children = router.options.routes[0].children;
router.addRoute(flattenRouters);
}
}