diff --git a/components/menu/src/MenuItem.tsx b/components/menu/src/MenuItem.tsx index 09f07f4aa..49f7f7405 100644 --- a/components/menu/src/MenuItem.tsx +++ b/components/menu/src/MenuItem.tsx @@ -94,6 +94,10 @@ export default defineComponent({ keyPath: keysPath.value, eventKeyPath: [...parentEventKeys.value, eventKey], domEvent: e, + item: { + ...props, + ...attrs, + }, }; }; diff --git a/components/menu/src/interface.ts b/components/menu/src/interface.ts index 0df2bd0c3..19afc7116 100644 --- a/components/menu/src/interface.ts +++ b/components/menu/src/interface.ts @@ -1,4 +1,5 @@ import type { Key } from '../../_util/type'; +import type { MenuItemProps } from './MenuItem'; export type MenuTheme = 'light' | 'dark'; @@ -24,6 +25,7 @@ export interface MenuInfo { keyPath?: Key[]; eventKeyPath: string[]; domEvent: MouseEvent | KeyboardEvent; + item: MenuItemProps & { [key: string]: any }; } export interface MenuTitleInfo { diff --git a/components/modal/Modal.tsx b/components/modal/Modal.tsx index 75d9a3712..27e5d5579 100644 --- a/components/modal/Modal.tsx +++ b/components/modal/Modal.tsx @@ -7,8 +7,8 @@ import addEventListener from '../vc-util/Dom/addEventListener'; import { getConfirmLocale } from './locale'; import CloseOutlined from '@ant-design/icons-vue/CloseOutlined'; import Button from '../button'; -import type { ButtonProps as ButtonPropsType } from '../button/buttonTypes'; -import buttonTypes, { ButtonType } from '../button/buttonTypes'; +import type { ButtonProps as ButtonPropsType, ButtonType } from '../button/buttonTypes'; +import buttonTypes from '../button/buttonTypes'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; import { getComponent, getSlot } from '../_util/props-util'; import initDefaultProps from '../_util/props-util/initDefaultProps';