chore: add menu onClick ts type (#2758)

* chore: add menu click type

* chore: change menu onClick definition

* chore: update menu onClick type
This commit is contained in:
zkwolf 2020-09-10 10:34:41 +08:00 committed by GitHub
parent 05a6f82644
commit 19c4ec819a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
types/menu/menu.d.ts vendored
View File

@ -14,7 +14,7 @@ export declare class Menu extends AntdComponent {
static SubMenu: typeof SubMenu;
static ItemGroup: typeof MenuItemGroup;
static Divider: typeof Divider;
$props: AntdProps & {
$props: Omit<AntdProps, 'onClick'> & {
/**
* Allow selection of multiple items
* @default false
@ -106,5 +106,16 @@ export declare class Menu extends AntdComponent {
* @type boolean
*/
inlineCollapsed?: boolean;
/**
* set the handler to handle click event
* @param params
*/
onClick?: (params: {
key: string | number;
keyPath: string[] | number[];
item: any;
domEvent: MouseEvent;
}) => void;
};
}