Skip to content

Commit 3217222

Browse files
committed
fix: initRouter
1 parent fcdfe6d commit 3217222

File tree

3 files changed

+35
-40
lines changed

3 files changed

+35
-40
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"vue": "^3.2.31",
5959
"vue-i18n": "^9.2.0-beta.30",
6060
"vue-json-pretty": "^2.0.2",
61-
"vue-router": "^4.0.12",
61+
"vue-router": "^4.0.13",
6262
"vue-types": "^4.1.1",
6363
"vuedraggable": "4.1.0",
6464
"vxe-table": "^4.1.21",
@@ -121,10 +121,10 @@
121121
"vite-plugin-mock": "^2.9.6",
122122
"vite-plugin-remove-console": "^0.0.6",
123123
"vite-plugin-style-import": "1.4.1",
124-
"vite-plugin-windicss": "^1.7.0",
124+
"vite-plugin-windicss": "^1.8.2",
125125
"vite-svg-loader": "2.2.0",
126126
"vue-eslint-parser": "^8.2.0",
127-
"windicss": "^3.4.3"
127+
"windicss": "^3.5.1"
128128
},
129129
"repository": "[email protected]:xiaoxian521/vue-pure-admin.git",
130130
"author": "xiaoxian521",

pnpm-lock.yaml

Lines changed: 28 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/router/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ function initRouter(name: string) {
127127
// 最终路由进行升序
128128
ascending(router.options.routes[0].children);
129129
if (!router.hasRoute(v?.name)) router.addRoute(v);
130+
const flattenRouters = router
131+
.getRoutes()
132+
.find(n => n.path === "/");
133+
router.addRoute(flattenRouters);
130134
}
131135
resolve(router);
132136
}

0 commit comments

Comments
 (0)