vben
2020-10-22 5cff73bcafc27a36f111949d33f463dd2bb52571
fix: fix the problem of collapsed display when the menu has no child nodes
2个文件已修改
16 ■■■■■ 已修改文件
src/components/Menu/src/index.less 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layouts/default/LayoutBreadcrumb.tsx 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Menu/src/index.less
@@ -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();
      }
    }
  }
src/layouts/default/LayoutBreadcrumb.tsx
@@ -46,11 +46,13 @@
      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,10 +73,8 @@
    );
    return () => (
      <>
        <Breadcrumb class="layout-breadcrumb">
          {() => (
            <>
              <TransitionGroup name="breadcrumb">
                {() => {
                  return unref(itemList).map((item) => {
@@ -98,10 +98,8 @@
                  });
                }}
              </TransitionGroup>
            </>
          )}
        </Breadcrumb>
      </>
    );
  },
});