mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-03 13:44:47 +08:00
feat: 支持后端传component组件路径
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user