fix: 优化菜单配置
This commit is contained in:
parent
5dd01e5863
commit
56052135c0
|
@ -179,13 +179,13 @@ const handleMeta = (item: MenuItem, isApp: boolean) => {
|
|||
}
|
||||
}
|
||||
|
||||
const findComponents = (code: string, level: number, isApp: boolean, components: any) => {
|
||||
const findComponents = (code: string, level: number, isApp: boolean, components: any, mate: any, hasChildren: boolean) => {
|
||||
const myComponents = components[code]
|
||||
if (level === 1) { // BasicLayoutPage
|
||||
if (myComponents) {
|
||||
return h(BasicLayoutPage, {}, () => [h(defineAsyncComponent(() => myComponents()), {})])
|
||||
if (myComponents && !hasChildren) {
|
||||
return mate?.hasLayout === false ? () => myComponents() : h(BasicLayoutPage, {}, () => [h(defineAsyncComponent(() => myComponents()), {})])
|
||||
}
|
||||
if (isApp) {
|
||||
if (isApp && !hasChildren) {
|
||||
return h(BasicLayoutPage, {}, () => [h(Iframe, {})])
|
||||
}
|
||||
return myComponents ? () => myComponents() : BasicLayoutPage
|
||||
|
@ -266,7 +266,7 @@ export const handleMenus = (menuData: any[], components: any, level: number = 1)
|
|||
children: item.children
|
||||
}
|
||||
|
||||
route.component = findComponents(item.code, level, isApp, components)
|
||||
route.component = findComponents(item.code, level, isApp, components, item.meta, !!item.chidlren?.length)
|
||||
const extraRoute = hasExtraChildren(item, extraRouteObj)
|
||||
const detail_components = findDetailRouteItem(item, components)
|
||||
|
||||
|
|
Loading…
Reference in New Issue