diff --git a/core/core-frontend/src/router/establish.ts b/core/core-frontend/src/router/establish.ts index 271dc4f375..c7e5023466 100644 --- a/core/core-frontend/src/router/establish.ts +++ b/core/core-frontend/src/router/establish.ts @@ -4,6 +4,7 @@ import { XpackComponent } from '@/components/plugin' const modules = import.meta.glob('../views/**/*.vue') export const Layout = () => import('@/layout/index.vue') const xpackComName = 'components/plugin' +export const LayoutTransition = () => import('@/layout/components/LayoutTransition.vue') // 后端控制路由生成 export const generateRoutesFn2 = (routes: AppCustomRouteRecordRaw[]): AppRouteRecordRaw[] => { const res: AppRouteRecordRaw[] = [] @@ -37,12 +38,14 @@ export const generateRoutesFn2 = (routes: AppCustomRouteRecordRaw[]): AppRouteRe let comModule = null if (route.component === xpackComName) { comModule = XpackComponent - } else { + } else if (!route.component.startsWith('Layout')) { comModule = modules[`../views/${route.component}/index.vue`] } if (route.component === 'Layout') { data.component = Layout + } else if (route.component === 'LayoutTransition') { + data.component = LayoutTransition } else if (!comModule) { } else { data.component = comModule