Skip to content

Commit 19c4ec8

Browse files
authored
chore: add menu onClick ts type (#2758)
* chore: add menu click type * chore: change menu onClick definition * chore: update menu onClick type
1 parent 05a6f82 commit 19c4ec8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

types/menu/menu.d.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export declare class Menu extends AntdComponent {
1414
static SubMenu: typeof SubMenu;
1515
static ItemGroup: typeof MenuItemGroup;
1616
static Divider: typeof Divider;
17-
$props: AntdProps & {
17+
$props: Omit<AntdProps, 'onClick'> & {
1818
/**
1919
* Allow selection of multiple items
2020
* @default false
@@ -106,5 +106,16 @@ export declare class Menu extends AntdComponent {
106106
* @type boolean
107107
*/
108108
inlineCollapsed?: boolean;
109+
110+
/**
111+
* set the handler to handle click event
112+
* @param params
113+
*/
114+
onClick?: (params: {
115+
key: string | number;
116+
keyPath: string[] | number[];
117+
item: any;
118+
domEvent: MouseEvent;
119+
}) => void;
109120
};
110121
}

0 commit comments

Comments
 (0)