Skip to content

Commit e3c38b6

Browse files
author
binhaoCen
authored
chore: update type dropdown (#2721)
1 parent 6681b50 commit e3c38b6

File tree

2 files changed

+104
-97
lines changed

2 files changed

+104
-97
lines changed

types/dropdown/dropdown-button.d.ts

+52-47
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,58 @@
44

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

89
export declare class DropdownButton extends AntdComponent {
9-
/**
10-
* whether the dropdown menu is disabled
11-
* @type boolean
12-
*/
13-
disabled: boolean;
14-
15-
/**
16-
* the dropdown menu
17-
* @type () => Menu
18-
*/
19-
overlay: any;
20-
21-
/**
22-
* placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight
23-
* @default 'bottomLeft'
24-
* @type string
25-
*/
26-
placement: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
27-
28-
/**
29-
* size of the button, the same as Button
30-
* @default 'default'
31-
* @type string
32-
*/
33-
size: 'small' | 'large' | 'default';
34-
35-
/**
36-
* the trigger mode which executes the drop-down action
37-
* @default ['hover']
38-
* @type string[]
39-
*/
40-
trigger: Array<'click' | 'hover' | 'contextmenu'>;
41-
42-
/**
43-
* type of the button, the same as Button
44-
* @default 'default'
45-
* @type string
46-
*/
47-
type: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default';
48-
49-
/**
50-
* whether the dropdown menu is visible
51-
* @type boolean
52-
*/
53-
visible: boolean;
54-
icon: any;
55-
title: string;
10+
$props: {
11+
/**
12+
* whether the dropdown menu is disabled
13+
* @type boolean
14+
*/
15+
disabled?: boolean;
16+
17+
/**
18+
* the dropdown menu
19+
* @type () => Menu
20+
*/
21+
overlay?: () => Menu
22+
23+
/**
24+
* placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight
25+
* @default 'bottomLeft'
26+
* @type string
27+
*/
28+
placement?: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
29+
30+
/**
31+
* size of the button, the same as Button
32+
* @default 'default'
33+
* @type string
34+
*/
35+
size?: 'small' | 'large' | 'default';
36+
37+
/**
38+
* the trigger mode which executes the drop-down action
39+
* @default ['hover']
40+
* @type string[]
41+
*/
42+
trigger?: Array<'click' | 'hover' | 'contextmenu'>;
43+
44+
/**
45+
* type of the button, the same as Button
46+
* @default 'default'
47+
* @type string
48+
*/
49+
type?: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default';
50+
51+
/**
52+
* whether the dropdown menu is visible
53+
* @type boolean
54+
*/
55+
visible?: boolean;
56+
/**
57+
* Icon (appears on the right) (1.5.0)
58+
*/
59+
icon?: VNodeChild | JSX.Element;
60+
}
5661
}

types/dropdown/dropdown.d.ts

+52-50
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,60 @@
55
import { AntdComponent } from '../component';
66
import { Menu } from '../menu/menu';
77
import { DropdownButton } from './dropdown-button';
8+
import { CSSProperties } from 'vue';
89

910
export declare class Dropdown extends AntdComponent {
1011
static Button: typeof DropdownButton;
12+
$props: {
13+
/**
14+
* the trigger mode which executes the drop-down action
15+
* @default ['hover']
16+
* @type string[]
17+
*/
18+
trigger?: Array<'click' | 'hover' | 'contextmenu'>;
1119

12-
/**
13-
* the trigger mode which executes the drop-down action
14-
* @default ['hover']
15-
* @type string[]
16-
*/
17-
trigger: Array<'click' | 'hover' | 'contextmenu'>;
18-
19-
/**
20-
* the dropdown menu
21-
* @type () => Menu
22-
*/
23-
overlay: any;
24-
25-
/**
26-
* Class name of the dropdown root element
27-
* @type string
28-
*/
29-
overlayClassName: string;
30-
31-
/**
32-
* Style of the dropdown root element
33-
* @type object
34-
*/
35-
overlayStyle: object;
36-
37-
/**
38-
* whether the dropdown menu is visible
39-
* @type boolean
40-
*/
41-
visible: boolean;
42-
43-
/**
44-
* whether the dropdown menu is disabled
45-
* @type boolean
46-
*/
47-
disabled: boolean;
48-
49-
/**
50-
* to set the ontainer of the dropdown menu. The default is to create a div element in body, you can reset it to the scrolling area and make a relative reposition.
51-
* @default () => document.body
52-
* @type Function
53-
*/
54-
getPopupContainer: (triggerNode?: any) => HTMLElement;
55-
56-
/**
57-
* placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight
58-
* @default 'bottomLeft'
59-
* @type string
60-
*/
61-
placement: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
20+
/**
21+
* the dropdown menu
22+
* @type () => Menu
23+
*/
24+
overlay?: () => Menu
25+
26+
/**
27+
* Class name of the dropdown root element
28+
* @type string
29+
*/
30+
overlayClassName?: string;
31+
32+
/**
33+
* Style of the dropdown root element
34+
* @type object
35+
*/
36+
overlayStyle?: CSSProperties;
37+
38+
/**
39+
* whether the dropdown menu is visible
40+
* @type boolean
41+
*/
42+
visible?: boolean;
43+
44+
/**
45+
* whether the dropdown menu is disabled
46+
* @type boolean
47+
*/
48+
disabled?: boolean;
49+
50+
/**
51+
* to set the ontainer of the dropdown menu. The default is to create a div element in body, you can reset it to the scrolling area and make a relative reposition.
52+
* @default () => document.body
53+
* @type Function
54+
*/
55+
getPopupContainer?: (triggerNode?: any) => HTMLElement;
56+
57+
/**
58+
* placement of pop menu: bottomLeft bottomCenter bottomRight topLeft topCenter topRight
59+
* @default 'bottomLeft'
60+
* @type string
61+
*/
62+
placement?: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
63+
}
6264
}

0 commit comments

Comments
 (0)