-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathtype.ts
More file actions
125 lines (119 loc) · 2.34 KB
/
type.ts
File metadata and controls
125 lines (119 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/* eslint-disable */
/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */
import { StickyProps } from '../sticky';
import type { TNode, TElement } from '../common';
export interface TdTabsProps {
/**
* 动画效果设置。其中 duration 表示动画时长
*/
animation?: TabAnimation;
/**
* 激活下划线的模式
* @default fixed
*/
bottomLineMode?: 'fixed' | 'auto' | 'full';
/**
* 选项卡列表
*/
list?: Array<TdTabPanelProps>;
/**
* 是否展示底部激活线条
* @default true
*/
showBottomLine?: boolean;
/**
* 组件尺寸
* @default medium
*/
size?: 'medium' | 'large';
/**
* 选项卡头部空间是否均分
* @default true
*/
spaceEvenly?: boolean;
/**
* 是否展示分割线
* @default true
*/
split?: boolean;
/**
* 是否开启粘性布局
* @default false
*/
sticky?: boolean;
/**
* 透传至 Sticky 组件
*/
stickyProps?: StickyProps;
/**
* 是否可以滑动切换
* @default true
*/
swipeable?: boolean;
/**
* 标签的样式
* @default line
*/
theme?: 'line' | 'tag' | 'card';
/**
* 激活的选项卡值
*/
value?: TabValue;
/**
* 激活的选项卡值,非受控属性
*/
defaultValue?: TabValue;
/**
* 激活的选项卡发生变化时触发
*/
onChange?: (value: TabValue, label: string) => void;
/**
* 点击选项卡时触发
*/
onClick?: (value: TabValue, label: string) => void;
/**
* 页面滚动时触发
*/
onScroll?: (scrollTop: number, isFixed: boolean) => void;
}
export interface TdTabPanelProps {
/**
* 透传至 Badge 组件
*/
badgeProps?: object;
/**
* 选项卡内容隐藏时是否销毁
* @default true
*/
destroyOnHide?: boolean;
/**
* 是否禁用当前选项卡
* @default false
*/
disabled?: boolean;
/**
* 图标
*/
icon?: TElement;
/**
* 选项卡名称,可自定义选项卡导航内容
*/
label?: TNode;
/**
* 是否启用选项卡懒加载
* @default false
*/
lazy?: boolean;
/**
* 用于自定义选项卡面板内容
*/
panel?: TNode;
/**
* 选项卡的值,唯一标识
*/
value?: TabValue;
}
export type TabAnimation = { duration: number } & Record<string, any>;
export type TabValue = string | number;