fix: router

This commit is contained in:
xiaoxian521
2021-12-13 17:30:08 +08:00
parent e97bd9c8c4
commit 438aab9bfc
7 changed files with 73 additions and 58 deletions

View File

@@ -216,7 +216,11 @@ const addAsyncRoutes = (arrRoutes: Array<RouteRecordRaw>) => {
if (v.redirect) {
v.component = Layout;
} else {
v.component = modulesRoutes[`/src/views${v.path}/index.vue`];
if (v.meta.realPath) {
v.component = modulesRoutes[`/src/views${v.meta.realPath}/index.vue`];
} else {
v.component = modulesRoutes[`/src/views${v.path}/index.vue`];
}
}
if (v.children) {
addAsyncRoutes(v.children);