Skip to content

Commit 32bedc9

Browse files
author
binhaoCen
authored
chore: update type tabs (#2740)
1 parent 8694abf commit 32bedc9

File tree

2 files changed

+77
-72
lines changed

2 files changed

+77
-72
lines changed

types/tabs/tab-pane.d.ts

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,27 @@
33
// Definitions: https://github.com/vueComponent/ant-design-vue/types
44

55
import { AntdComponent } from '../component';
6+
import { VNodeChild } from 'vue';
67

78
export declare class TabPane extends AntdComponent {
8-
/**
9-
* Forced render of content in tabs, not lazy render after clicking on tabs
10-
* @default false
11-
* @type boolean
12-
*/
13-
forceRender: boolean;
9+
$props: {
10+
/**
11+
* Forced render of content in tabs, not lazy render after clicking on tabs
12+
* @default false
13+
* @type boolean
14+
*/
15+
forceRender?: boolean;
1416

15-
/**
16-
* TabPane's key
17-
* @type string
18-
*/
19-
key: string;
17+
/**
18+
* TabPane's key
19+
* @type string
20+
*/
21+
key?: string;
2022

21-
/**
22-
* Show text in TabPane's head
23-
* @type any (string | slot)
24-
*/
25-
tab: any;
23+
/**
24+
* Show text in TabPane's head
25+
* @type any (string | slot)
26+
*/
27+
tab?: VNodeChild | JSX.Element;
28+
}
2629
}

types/tabs/tabs.d.ts

Lines changed: 58 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,74 @@
44

55
import { AntdComponent } from '../component';
66
import { TabPane } from './tab-pane';
7+
import { CSSProperties, VNodeChild } from 'vue';
78

89
export declare class Tabs extends AntdComponent {
910
static TabPane: typeof TabPane;
11+
$props: {
12+
/**
13+
* Current TabPane's key
14+
* @type string
15+
*/
16+
activeKey?: string;
1017

11-
/**
12-
* Current TabPane's key
13-
* @type string
14-
*/
15-
activeKey: string;
18+
/**
19+
* Whether to change tabs with animation. Only works while tabPosition="top"\|"bottom"
20+
* @default true, false when type="card"
21+
* @type boolean | object
22+
*/
23+
animated?: boolean | { inkBar: boolean; tabPane: boolean };
1624

17-
/**
18-
* Whether to change tabs with animation. Only works while tabPosition="top"\|"bottom"
19-
* @default true, false when type="card"
20-
* @type boolean | object
21-
*/
22-
animated: boolean | { inkBar: boolean; tabPane: boolean };
25+
/**
26+
* Initial active TabPane's key, if activeKey is not set.
27+
* @type string
28+
*/
29+
defaultActiveKey?: string;
2330

24-
/**
25-
* Initial active TabPane's key, if activeKey is not set.
26-
* @type string
27-
*/
28-
defaultActiveKey: string;
31+
/**
32+
* Hide plus icon or not. Only works while type="editable-card"
33+
* @default false
34+
* @type boolean
35+
*/
36+
hideAdd?: boolean;
2937

30-
/**
31-
* Hide plus icon or not. Only works while type="editable-card"
32-
* @default false
33-
* @type boolean
34-
*/
35-
hideAdd: boolean;
38+
/**
39+
* preset tab bar size
40+
* @default 'default'
41+
* @type string
42+
*/
43+
size?: 'default' | 'small' | 'large';
3644

37-
/**
38-
* preset tab bar size
39-
* @default 'default'
40-
* @type string
41-
*/
42-
size: 'default' | 'small' | 'large';
45+
/**
46+
* Extra content in tab bar
47+
* @type any
48+
*/
49+
tabBarExtraContent?: VNodeChild | JSX.Element;
4350

44-
/**
45-
* Extra content in tab bar
46-
* @type any
47-
*/
48-
tabBarExtraContent: any;
51+
/**
52+
* Tab bar style object
53+
* @type object
54+
*/
55+
tabBarStyle?: CSSProperties;
4956

50-
/**
51-
* Tab bar style object
52-
* @type object
53-
*/
54-
tabBarStyle: object;
57+
/**
58+
* Position of tabs
59+
* @default 'top'
60+
* @type string
61+
*/
62+
tabPosition?: 'top' | 'right' | 'bottom' | 'left';
5563

56-
/**
57-
* Position of tabs
58-
* @default 'top'
59-
* @type string
60-
*/
61-
tabPosition: 'top' | 'right' | 'bottom' | 'left';
64+
/**
65+
* Basic style of tabs
66+
* @default 'line'
67+
* @type string
68+
*/
69+
type?: 'line' | 'card' | 'editable-card';
6270

63-
/**
64-
* Basic style of tabs
65-
* @default 'line'
66-
* @type string
67-
*/
68-
type: 'line' | 'card' | 'editable-card';
69-
70-
/**
71-
* The gap between tabs
72-
* @type number
73-
*/
74-
tabBarGutter: number;
71+
/**
72+
* The gap between tabs
73+
* @type number
74+
*/
75+
tabBarGutter?: number;
76+
}
7577
}

0 commit comments

Comments
 (0)