fix(web): 修复工作台菜单图标继承
This commit is contained in:
1 parent
73da0bbd85
commit
bb03a5ad84
1 file changed
+7
-4
@@ -22,14 +22,17 @@ export const useRenderMenuItem = () =>
|
|||||||
(!onlyOneChild?.children || onlyOneChild?.noShowingChildren) &&
|
(!onlyOneChild?.children || onlyOneChild?.noShowingChildren) &&
|
||||||
!meta?.alwaysShow
|
!meta?.alwaysShow
|
||||||
) {
|
) {
|
||||||
|
const leafMeta = onlyOneChild?.meta
|
||||||
|
? {
|
||||||
|
...onlyOneChild.meta,
|
||||||
|
icon: onlyOneChild.meta.icon || meta.icon
|
||||||
|
}
|
||||||
|
: meta
|
||||||
return (
|
return (
|
||||||
<ElMenuItem
|
<ElMenuItem
|
||||||
index={onlyOneChild ? pathResolve(fullPath, onlyOneChild.path) : fullPath}
|
index={onlyOneChild ? pathResolve(fullPath, onlyOneChild.path) : fullPath}
|
||||||
>
|
>
|
||||||
{{
|
{{ default: () => renderMenuTitle(leafMeta, !nested) }}
|
||||||
default: () =>
|
|
||||||
renderMenuTitle(onlyOneChild ? onlyOneChild?.meta : meta, !nested)
|
|
||||||
}}
|
|
||||||
</ElMenuItem>
|
</ElMenuItem>
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user