|
@ -30,7 +30,7 @@ export interface SubMenuProps { |
|
|
function SubMenu(props: SubMenuProps) { |
|
|
function SubMenu(props: SubMenuProps) { |
|
|
const { popupClassName, icon, title, theme: customTheme } = props; |
|
|
const { popupClassName, icon, title, theme: customTheme } = props; |
|
|
const context = React.useContext(MenuContext); |
|
|
const context = React.useContext(MenuContext); |
|
|
const { prefixCls, inlineCollapsed, theme: contextTheme } = context; |
|
|
const { prefixCls, inlineCollapsed, theme: contextTheme, mode } = context; |
|
|
|
|
|
|
|
|
const parentPath = useFullPath(); |
|
|
const parentPath = useFullPath(); |
|
|
|
|
|
|
|
@ -68,10 +68,12 @@ function SubMenu(props: SubMenuProps) { |
|
|
[context], |
|
|
[context], |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const popupOffset = mode === 'horizontal' ? [0, 8] : [10, 0]; |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<MenuContext.Provider value={contextValue}> |
|
|
<MenuContext.Provider value={contextValue}> |
|
|
<RcSubMenu |
|
|
<RcSubMenu |
|
|
popupOffset={[10, 0]} |
|
|
popupOffset={popupOffset} |
|
|
{...omit(props, ['icon'])} |
|
|
{...omit(props, ['icon'])} |
|
|
title={titleNode} |
|
|
title={titleNode} |
|
|
popupClassName={classNames( |
|
|
popupClassName={classNames( |
|
|