perf: 同步完整版代码

This commit is contained in:
xiaoxian521
2022-04-08 12:05:46 +08:00
parent bc8a0f3b35
commit 2bac78478c
10 changed files with 59 additions and 29 deletions

View File

@@ -234,7 +234,11 @@ function addAsyncRoutes(arrRoutes: Array<RouteRecordRaw>) {
} else if (v.meta?.frameSrc) {
v.component = IFrame;
} else {
const index = modulesRoutesKeys.findIndex(ev => ev.includes(v.path));
// 对后端传component组件路径和不传做兼容如果后端传component组件路径那么path可以随便写如果不传component组件路径会根path保持一致
const index = v?.component
? // @ts-expect-error
modulesRoutesKeys.findIndex(ev => ev.includes(v.component))
: modulesRoutesKeys.findIndex(ev => ev.includes(v.path));
v.component = modulesRoutes[modulesRoutesKeys[index]];
}
if (v.children) {