fix: initRouter

This commit is contained in:
xiaoxian521
2022-03-03 22:40:53 +08:00
parent fcdfe6d0c0
commit 32172220f7
3 changed files with 35 additions and 40 deletions

View File

@@ -127,6 +127,10 @@ function initRouter(name: string) {
// 最终路由进行升序
ascending(router.options.routes[0].children);
if (!router.hasRoute(v?.name)) router.addRoute(v);
const flattenRouters = router
.getRoutes()
.find(n => n.path === "/");
router.addRoute(flattenRouters);
}
resolve(router);
}