forked from github/dataease
fix(X-Pack): 同步管理菜单无法展示
This commit is contained in:
parent
1a3090b7c6
commit
7988fd2106
@ -4,6 +4,7 @@ import { XpackComponent } from '@/components/plugin'
|
|||||||
const modules = import.meta.glob('../views/**/*.vue')
|
const modules = import.meta.glob('../views/**/*.vue')
|
||||||
export const Layout = () => import('@/layout/index.vue')
|
export const Layout = () => import('@/layout/index.vue')
|
||||||
const xpackComName = 'components/plugin'
|
const xpackComName = 'components/plugin'
|
||||||
|
export const LayoutTransition = () => import('@/layout/components/LayoutTransition.vue')
|
||||||
// 后端控制路由生成
|
// 后端控制路由生成
|
||||||
export const generateRoutesFn2 = (routes: AppCustomRouteRecordRaw[]): AppRouteRecordRaw[] => {
|
export const generateRoutesFn2 = (routes: AppCustomRouteRecordRaw[]): AppRouteRecordRaw[] => {
|
||||||
const res: AppRouteRecordRaw[] = []
|
const res: AppRouteRecordRaw[] = []
|
||||||
@ -37,12 +38,14 @@ export const generateRoutesFn2 = (routes: AppCustomRouteRecordRaw[]): AppRouteRe
|
|||||||
let comModule = null
|
let comModule = null
|
||||||
if (route.component === xpackComName) {
|
if (route.component === xpackComName) {
|
||||||
comModule = XpackComponent
|
comModule = XpackComponent
|
||||||
} else {
|
} else if (!route.component.startsWith('Layout')) {
|
||||||
comModule = modules[`../views/${route.component}/index.vue`]
|
comModule = modules[`../views/${route.component}/index.vue`]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (route.component === 'Layout') {
|
if (route.component === 'Layout') {
|
||||||
data.component = Layout
|
data.component = Layout
|
||||||
|
} else if (route.component === 'LayoutTransition') {
|
||||||
|
data.component = LayoutTransition
|
||||||
} else if (!comModule) {
|
} else if (!comModule) {
|
||||||
} else {
|
} else {
|
||||||
data.component = comModule
|
data.component = comModule
|
||||||
|
Loading…
Reference in New Issue
Block a user