Skip to content

Commit

Permalink
feat: menu event args add item #4290
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Jun 29, 2021
1 parent 9a86d1b commit 0c3d9d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions components/menu/src/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ export default defineComponent({
keyPath: keysPath.value,
eventKeyPath: [...parentEventKeys.value, eventKey],
domEvent: e,
item: {
...props,
...attrs,
},
};
};

Expand Down
2 changes: 2 additions & 0 deletions components/menu/src/interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Key } from '../../_util/type';
import type { MenuItemProps } from './MenuItem';

export type MenuTheme = 'light' | 'dark';

Expand All @@ -24,6 +25,7 @@ export interface MenuInfo {
keyPath?: Key[];
eventKeyPath: string[];
domEvent: MouseEvent | KeyboardEvent;
item: MenuItemProps & { [key: string]: any };
}

export interface MenuTitleInfo {
Expand Down
4 changes: 2 additions & 2 deletions components/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 0c3d9d5

Please sign in to comment.