From e5ce60157483241eeb3d1fcaec650dd2a217f2d1 Mon Sep 17 00:00:00 2001 From: ice <1597834867@qq.com> Date: Thu, 24 Oct 2024 15:20:27 +0800 Subject: [PATCH] fix: add extra pass --- assets/index.less | 2 +- src/MenuItem.tsx | 4 ++-- src/utils/nodeUtil.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/index.less b/assets/index.less index 2f433814..2755ad07 100644 --- a/assets/index.less +++ b/assets/index.less @@ -104,7 +104,7 @@ display: flex; align-items: center; - .@{menuPrefixCls}-extra { + .@{menuPrefixCls}-item-extra { margin-left: auto; font-size: 14px; } diff --git a/src/MenuItem.tsx b/src/MenuItem.tsx index 284747a3..fb83fece 100644 --- a/src/MenuItem.tsx +++ b/src/MenuItem.tsx @@ -16,7 +16,7 @@ import type { MenuInfo, MenuItemType } from './interface'; import { warnItemProp } from './utils/warnUtil'; export interface MenuItemProps - extends Omit, + extends Omit, Omit< React.HTMLAttributes, 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onSelect' @@ -209,7 +209,7 @@ const InternalMenuItem = React.forwardRef( role={role === null ? 'none' : role || 'menuitem'} tabIndex={disabled ? null : -1} data-menu-id={overflowDisabled && domDataId ? null : domDataId} - {...restProps} + {...omit(restProps, ['extra'])} {...activeProps} {...optionRoleProps} component="li" diff --git a/src/utils/nodeUtil.tsx b/src/utils/nodeUtil.tsx index af53ac84..c0b81106 100644 --- a/src/utils/nodeUtil.tsx +++ b/src/utils/nodeUtil.tsx @@ -49,7 +49,7 @@ function convertItemsToNodes( } return ( - + {label} {(!!extra || extra === 0) && ( {extra}