Skip to content

Commit

Permalink
fix: initRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxian521 committed Mar 3, 2022
1 parent fcdfe6d commit 3217222
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 40 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"vue": "^3.2.31",
"vue-i18n": "^9.2.0-beta.30",
"vue-json-pretty": "^2.0.2",
"vue-router": "^4.0.12",
"vue-router": "^4.0.13",
"vue-types": "^4.1.1",
"vuedraggable": "4.1.0",
"vxe-table": "^4.1.21",
Expand Down Expand Up @@ -121,10 +121,10 @@
"vite-plugin-mock": "^2.9.6",
"vite-plugin-remove-console": "^0.0.6",
"vite-plugin-style-import": "1.4.1",
"vite-plugin-windicss": "^1.7.0",
"vite-plugin-windicss": "^1.8.2",
"vite-svg-loader": "2.2.0",
"vue-eslint-parser": "^8.2.0",
"windicss": "^3.4.3"
"windicss": "^3.5.1"
},
"repository": "[email protected]:xiaoxian521/vue-pure-admin.git",
"author": "xiaoxian521",
Expand Down
65 changes: 28 additions & 37 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/router/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 3217222

Please sign in to comment.