Skip to content

Commit

Permalink
fix(layout): fix menu classname no work error
Browse files Browse the repository at this point in the history
close #7030
  • Loading branch information
chenshuai2144 committed May 8, 2023
1 parent 94c9c03 commit c64e81c
Show file tree
Hide file tree
Showing 5 changed files with 1,226 additions and 1,226 deletions.
4 changes: 2 additions & 2 deletions packages/layout/src/components/SiderMenu/BaseMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ const BaseMenu: React.FC<BaseMenuProps & PrivateSiderMenuProps> = (props) => {

const { dark, token: designToken } = useContext(ProProvider);

const baseClassName = `${prefixCls}-base-menu`;
const baseClassName = `${prefixCls}-base-menu-${mode}`;
// 用于减少 defaultOpenKeys 计算的组件
const defaultOpenKeysRef = useRef<string[]>([]);

Expand Down Expand Up @@ -569,7 +569,7 @@ const BaseMenu: React.FC<BaseMenuProps & PrivateSiderMenuProps> = (props) => {
// eslint-disable-next-line react-hooks/exhaustive-deps
[openKeys && openKeys.join(','), props.layout, props.collapsed],
);
const { wrapSSR, hashId } = useStyle(baseClassName + '-' + mode, mode);
const { wrapSSR, hashId } = useStyle(baseClassName, mode);

const menuUtils = useMemo(() => {
return new MenuUtil({
Expand Down
10 changes: 5 additions & 5 deletions tests/form/__snapshots__/demo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -48667,14 +48667,14 @@ exports[`form demos 📸 renders ./packages/form/src/demos/layout-footer.tsx cor
style="flex: 1; overflow-y: auto; overflow-x: hidden;"
>
<ul
class="ant-menu ant-menu-root ant-menu-vertical ant-menu-light ant-pro-sider-menu ant-pro-base-menu ant-pro-base-menu-collapsed ant-menu-inline-collapsed"
class="ant-menu ant-menu-root ant-menu-vertical ant-menu-light ant-pro-sider-menu ant-pro-base-menu-inline ant-pro-base-menu-inline-collapsed ant-menu-inline-collapsed"
data-menu-list="true"
role="menu"
style="background-color: transparent; width: 100%;"
tabindex="0"
>
<li
class="ant-menu-submenu ant-menu-submenu-vertical ant-pro-base-menu-submenu ant-pro-base-menu-submenu-has-icon ant-menu-submenu-selected"
class="ant-menu-submenu ant-menu-submenu-vertical ant-pro-base-menu-inline-submenu ant-pro-base-menu-inline-submenu-has-icon ant-menu-submenu-selected"
role="none"
>
<div
Expand All @@ -48690,10 +48690,10 @@ exports[`form demos 📸 renders ./packages/form/src/demos/layout-footer.tsx cor
class="ant-menu-title-content"
>
<div
class="ant-pro-base-menu-item-title ant-pro-base-menu-item-title-collapsed"
class="ant-pro-base-menu-inline-item-title ant-pro-base-menu-inline-item-title-collapsed"
>
<span
class="ant-pro-base-menu-item-icon "
class="ant-pro-base-menu-inline-item-icon "
>
<span
aria-label="smile"
Expand All @@ -48716,7 +48716,7 @@ exports[`form demos 📸 renders ./packages/form/src/demos/layout-footer.tsx cor
</span>
</span>
<span
class="ant-pro-base-menu-item-text ant-pro-base-menu-item-text-has-icon"
class="ant-pro-base-menu-inline-item-text ant-pro-base-menu-inline-item-text-has-icon"
>
一级名称
</span>
Expand Down
Loading

0 comments on commit c64e81c

Please sign in to comment.