feat: menu event args add item #4290

This commit is contained in:
tangjinzhou 2021-06-29 15:44:41 +08:00
parent 9a86d1b54d
commit 0c3d9d535d
3 changed files with 8 additions and 2 deletions

View File

@ -94,6 +94,10 @@ export default defineComponent({
keyPath: keysPath.value,
eventKeyPath: [...parentEventKeys.value, eventKey],
domEvent: e,
item: {
...props,
...attrs,
},
};
};

View File

@ -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 {

View File

@ -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';