Skip to content

Commit 4063fe6

Browse files
author
binhaoCen
authored
chore: update type menu (#2717)
1 parent 13b01d7 commit 4063fe6

File tree

4 files changed

+141
-130
lines changed

4 files changed

+141
-130
lines changed

types/menu/menu-item-group.d.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44

55
import { AntdComponent } from '../component';
66
import { MenuItem } from './menu-item';
7+
import { VNodeChild } from 'vue';
78

89
export declare class MenuItemGroup extends AntdComponent {
9-
/**
10+
$props:{
11+
/**
1012
* sub menu items
1113
* @type MenuItem[]
1214
*/
13-
children: MenuItem[];
14-
15+
children?: MenuItem[];
1516
/**
1617
* title of the group
1718
* @type string | slot
1819
*/
19-
title: any;
20+
title?: VNodeChild | JSX.Element;
21+
}
2022
}

types/menu/menu-item.d.ts

+18-16
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,24 @@
55
import { AntdComponent } from '../component';
66

77
export declare class MenuItem extends AntdComponent {
8-
/**
9-
* unique id of the menu item
10-
* @type string
11-
*/
12-
key: string;
8+
$props: {
9+
/**
10+
* unique id of the menu item
11+
* @type string
12+
*/
13+
key?: string;
1314

14-
/**
15-
* whether menu item is disabled or not
16-
* @default false
17-
* @type boolean
18-
*/
19-
disabled: boolean;
15+
/**
16+
* whether menu item is disabled or not
17+
* @default false
18+
* @type boolean
19+
*/
20+
disabled?: boolean;
2021

21-
/**
22-
* set display title for collapsed item
23-
* @type string
24-
*/
25-
title: string;
22+
/**
23+
* set display title for collapsed item
24+
* @type string
25+
*/
26+
title?: string;
27+
}
2628
}

types/menu/menu.d.ts

+94-92
Original file line numberDiff line numberDiff line change
@@ -7,102 +7,104 @@ import { MenuItem } from './menu-item';
77
import { SubMenu } from './sub-menu';
88
import { MenuItemGroup } from './menu-item-group';
99
import { Divider } from '../divider';
10+
import { CSSProperties } from 'vue';
1011

1112
export declare class Menu extends AntdComponent {
1213
static Item: typeof MenuItem;
1314
static SubMenu: typeof SubMenu;
1415
static ItemGroup: typeof MenuItemGroup;
1516
static Divider: typeof Divider;
16-
17-
/**
18-
* Allow selection of multiple items
19-
* @default false
20-
* @type boolean
21-
*/
22-
multiple: boolean;
23-
24-
/**
25-
* array with the keys of currently selected menu items
26-
* @type string[]
27-
*/
28-
selectedKeys: string[];
29-
30-
/**
31-
* array with the keys of default selected menu items
32-
* @type string[]
33-
*/
34-
defaultSelectedKeys: string[];
35-
36-
/**
37-
* array with the keys of default opened sub menus
38-
* @type any
39-
*/
40-
defaultOpenKeys: any;
41-
42-
/**
43-
* array with the keys of currently opened sub menus
44-
* @type string[]
45-
*/
46-
openKeys: string[];
47-
48-
/**
49-
* type of the menu; vertical, horizontal, and inline modes are supported
50-
* @default 'vertical'
51-
* @type string
52-
*/
53-
mode: 'horizontal' | 'vertical' | 'vertical-left' | 'vertical-right' | 'inline';
54-
55-
/**
56-
* delay time to show submenu when mouse enter, unit: second
57-
* @default 0
58-
* @type number
59-
*/
60-
subMenuOpenDelay: number;
61-
62-
/**
63-
* delay time to hide submenu when mouse leave, unit: second
64-
* @default 0.1
65-
* @type number
66-
*/
67-
subMenuCloseDelay: Number;
68-
69-
/**
70-
* indent px of inline menu item on each level
71-
* @default 24
72-
* @type number
73-
*/
74-
inlineIndent: number;
75-
76-
/**
77-
* style of the root node
78-
* @type object
79-
*/
80-
style: object;
81-
82-
/**
83-
* color theme of the menu
84-
* @default 'light'
85-
* @type string
86-
*/
87-
theme: 'light' | 'dark';
88-
89-
/**
90-
* render submenu into DOM before it shows
91-
* @default false
92-
* @type boolean
93-
*/
94-
forceSubMenuRender: boolean;
95-
96-
/**
97-
* allow selecting menu items
98-
* @default true
99-
* @type boolean
100-
*/
101-
selectable: boolean;
102-
103-
/**
104-
* specifies the collapsed status when menu is inline mode
105-
* @type boolean
106-
*/
107-
inlineCollapsed: boolean;
17+
$props: {
18+
/**
19+
* Allow selection of multiple items
20+
* @default false
21+
* @type boolean
22+
*/
23+
multiple?: boolean;
24+
25+
/**
26+
* array with the keys of currently selected menu items
27+
* @type string[]
28+
*/
29+
selectedKeys?: string[];
30+
31+
/**
32+
* array with the keys of default selected menu items
33+
* @type string[]
34+
*/
35+
defaultSelectedKeys?: string[];
36+
37+
/**
38+
* array with the keys of default opened sub menus
39+
* @type string[]
40+
*/
41+
defaultOpenKeys?: string[];
42+
43+
/**
44+
* array with the keys of currently opened sub menus
45+
* @type string[]
46+
*/
47+
openKeys?: string[];
48+
49+
/**
50+
* type of the menu; vertical, horizontal, and inline modes are supported
51+
* @default 'vertical'
52+
* @type string
53+
*/
54+
mode?: 'horizontal' | 'vertical' | 'vertical-left' | 'vertical-right' | 'inline';
55+
56+
/**
57+
* delay time to show submenu when mouse enter, unit: second
58+
* @default 0
59+
* @type number
60+
*/
61+
subMenuOpenDelay?: number;
62+
63+
/**
64+
* delay time to hide submenu when mouse leave, unit: second
65+
* @default 0.1
66+
* @type number
67+
*/
68+
subMenuCloseDelay?: number;
69+
70+
/**
71+
* indent px of inline menu item on each level
72+
* @default 24
73+
* @type number
74+
*/
75+
inlineIndent?: number;
76+
77+
/**
78+
* style of the root node
79+
* @type object
80+
*/
81+
style?: CSSProperties;
82+
83+
/**
84+
* color theme of the menu
85+
* @default 'light'
86+
* @type string
87+
*/
88+
theme?: 'light' | 'dark';
89+
90+
/**
91+
* render submenu into DOM before it shows
92+
* @default false
93+
* @type boolean
94+
*/
95+
forceSubMenuRender?: boolean;
96+
97+
/**
98+
* allow selecting menu items
99+
* @default true
100+
* @type boolean
101+
*/
102+
selectable?: boolean;
103+
104+
/**
105+
* specifies the collapsed status when menu is inline mode
106+
* @type boolean
107+
*/
108+
inlineCollapsed?: boolean;
109+
}
108110
}

types/menu/sub-menu.d.ts

+23-18
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,31 @@
44

55
import { AntdComponent } from '../component';
66
import { MenuItem } from './menu-item';
7+
import { VNodeChild } from 'vue';
78

89
export declare class SubMenu extends AntdComponent {
9-
/**
10-
* unique id of the menu item
11-
* @type string
12-
*/
13-
key: string;
10+
$props: {
11+
/**
12+
* unique id of the menu item
13+
* @type string
14+
*/
15+
key?: string;
1416

15-
/**
16-
* whether menu item is disabled or not
17-
* @default false
18-
* @type boolean
19-
*/
20-
disabled: boolean;
17+
/**
18+
* whether menu item is disabled or not
19+
* @default false
20+
* @type boolean
21+
*/
22+
disabled?: boolean;
2123

22-
/**
23-
* title of the sub menu
24-
* @type string | slot
25-
*/
26-
title: any;
27-
28-
popupClassName: string;
24+
/**
25+
* title of the sub menu
26+
* @type string | slot
27+
*/
28+
title?: VNodeChild | JSX.Element;
29+
/**
30+
* Sub-menu class name (1.5.0)
31+
*/
32+
popupClassName?: string;
33+
}
2934
}

0 commit comments

Comments
 (0)