mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-02-03 03:32:59 +08:00
fix: fix the problem of collapsed display when the menu has no child nodes
This commit is contained in:
parent
88de82c493
commit
5cff73bcaf
@ -248,15 +248,15 @@
|
||||
}
|
||||
|
||||
&.ant-menu-inline-collapsed {
|
||||
.ant-menu-submenu-selected,
|
||||
.ant-menu-item-selected {
|
||||
.active-style();
|
||||
}
|
||||
|
||||
.ant-menu-item-selected {
|
||||
background: unset !important;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.ant-menu-submenu-selected,
|
||||
.ant-menu-item-selected {
|
||||
.active-style();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,11 +46,13 @@ export default defineComponent({
|
||||
if (homeRoute.name === firstItem.name) return false;
|
||||
return homeRoute;
|
||||
}
|
||||
|
||||
function pathCompile(path: string) {
|
||||
const { params } = unref(currentRoute);
|
||||
const toPath = compile(path);
|
||||
return toPath(params);
|
||||
}
|
||||
|
||||
function handleItemClick(item: AppRouteRecordRaw) {
|
||||
const { redirect, path, meta } = item;
|
||||
if (meta.disabledRedirect) return;
|
||||
@ -71,37 +73,33 @@ export default defineComponent({
|
||||
);
|
||||
|
||||
return () => (
|
||||
<>
|
||||
<Breadcrumb class="layout-breadcrumb">
|
||||
{() => (
|
||||
<>
|
||||
<TransitionGroup name="breadcrumb">
|
||||
{() => {
|
||||
return unref(itemList).map((item) => {
|
||||
const isLink = !!item.redirect && !item.meta.disabledRedirect;
|
||||
return (
|
||||
<BreadcrumbItem
|
||||
key={item.path}
|
||||
isLink={isLink}
|
||||
onClick={handleItemClick.bind(null, item)}
|
||||
>
|
||||
{() => (
|
||||
<>
|
||||
{props.showIcon && item.meta.icon && item.meta.icon.trim() !== '' && (
|
||||
<Icon icon={item.meta.icon} class="icon mr-1 mb-1" />
|
||||
)}
|
||||
{item.meta.title}
|
||||
</>
|
||||
<Breadcrumb class="layout-breadcrumb">
|
||||
{() => (
|
||||
<TransitionGroup name="breadcrumb">
|
||||
{() => {
|
||||
return unref(itemList).map((item) => {
|
||||
const isLink = !!item.redirect && !item.meta.disabledRedirect;
|
||||
return (
|
||||
<BreadcrumbItem
|
||||
key={item.path}
|
||||
isLink={isLink}
|
||||
onClick={handleItemClick.bind(null, item)}
|
||||
>
|
||||
{() => (
|
||||
<>
|
||||
{props.showIcon && item.meta.icon && item.meta.icon.trim() !== '' && (
|
||||
<Icon icon={item.meta.icon} class="icon mr-1 mb-1" />
|
||||
)}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
});
|
||||
}}
|
||||
</TransitionGroup>
|
||||
</>
|
||||
)}
|
||||
</Breadcrumb>
|
||||
</>
|
||||
{item.meta.title}
|
||||
</>
|
||||
)}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
});
|
||||
}}
|
||||
</TransitionGroup>
|
||||
)}
|
||||
</Breadcrumb>
|
||||
);
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user