Skip to content

Commit 203e8c6

Browse files
author
binhaoCen
authored
chore: update type switch (#2695)
1 parent f34a5d9 commit 203e8c6

File tree

1 file changed

+45
-43
lines changed

1 file changed

+45
-43
lines changed

types/switch.d.ts

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,64 @@
33
// Definitions: https://github.com/vueComponent/ant-design-vue/types
44

55
import { AntdComponent } from './component';
6-
6+
import { VNodeChild } from 'vue';
77
export declare class Switch extends AntdComponent {
8-
/**
8+
$props: {
9+
/**
910
* get focus when component mounted
1011
* @default false
1112
* @type boolean
1213
*/
13-
autofocus: boolean;
14+
autofocus?: boolean;
1415

15-
/**
16-
* determine whether the Switch is checked
17-
* @default false
18-
* @type boolean
19-
*/
20-
checked: boolean;
16+
/**
17+
* determine whether the Switch is checked
18+
* @default false
19+
* @type boolean
20+
*/
21+
checked?: boolean;
2122

22-
/**
23-
* content to be shown when the state is checked
24-
* @type any (string | slot)
25-
*/
26-
checkedChildren: any;
23+
/**
24+
* content to be shown when the state is checked
25+
* @type any (string | slot)
26+
*/
27+
checkedChildren?: VNodeChild | JSX.Element;
2728

28-
/**
29-
* to set the initial state
30-
* @default false
31-
* @type boolean
32-
*/
33-
defaultChecked: boolean;
29+
/**
30+
* to set the initial state
31+
* @default false
32+
* @type boolean
33+
*/
34+
defaultChecked?: boolean;
3435

35-
/**
36-
* Disable switch
37-
* @default false
38-
* @type boolean
39-
*/
40-
disabled: boolean;
36+
/**
37+
* Disable switch
38+
* @default false
39+
* @type boolean
40+
*/
41+
disabled?: boolean;
4142

42-
/**
43-
* loading state of switch
44-
* @default false
45-
* @type boolean
46-
*/
47-
loading: boolean;
43+
/**
44+
* loading state of switch
45+
* @default false
46+
* @type boolean
47+
*/
48+
loading?: boolean;
4849

49-
/**
50-
* the size of the Switch, options: default small
51-
* @default 'default'
52-
* @type string
53-
*/
54-
size: 'small' | 'default' | 'large';
50+
/**
51+
* the size of the Switch, options: default small
52+
* @default 'default'
53+
* @type string
54+
*/
55+
size?: 'small' | 'default' | 'large';
5556

56-
/**
57-
* content to be shown when the state is unchecked
58-
* @type any (string | slot)
59-
*/
60-
unCheckedChildren: any;
57+
/**
58+
* content to be shown when the state is unchecked
59+
* @type any (string | slot)
60+
*/
61+
unCheckedChildren?: VNodeChild | JSX.Element;
6162

63+
}
6264
/**
6365
* remove focus
6466
*/

0 commit comments

Comments
 (0)