Skip to content

Commit ddbbc49

Browse files
authored
docs: generate slots documents for all components (#4008)
* docs: generate slots documents for all components * fix: fix test * docs: format
1 parent 4a3dd6c commit ddbbc49

File tree

105 files changed

+1170
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1170
-236
lines changed

packages/components/action-sheet/README.en-US.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ cancel | \- | \-
2929
close | `(trigger: ActionSheetTriggerSource)` | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/action-sheet/type.ts)。<br/>`type ActionSheetTriggerSource = 'overlay' \| 'command' \| 'select' `<br/>
3030
selected | `(selected: ActionSheetItem \| string, index: number)` | \-
3131

32+
### ActionSheet Slots
33+
34+
name | Description
35+
-- | --
36+
\- | \-
37+
3238
### ActionSheet External Classes
3339

3440
className | Description

packages/components/action-sheet/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ cancel | \- | 点击取消按钮时触发
117117
close | `(trigger: ActionSheetTriggerSource)` | 关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/action-sheet/type.ts)。<br/>`type ActionSheetTriggerSource = 'overlay' \| 'command' \| 'select' `<br/>
118118
selected | `(selected: ActionSheetItem \| string, index: number)` | 选择菜单项时触发
119119

120+
### ActionSheet Slots
121+
122+
名称 | 描述
123+
-- | --
124+
\- | 默认插槽,自定义内容区域内容
125+
120126
### ActionSheet External Classes
121127

122128
类名 | 描述

packages/components/avatar/README.en-US.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ name | params | description
2424
-- | -- | --
2525
error | - | trigger on image load failed
2626

27+
### Avatar Slots
28+
29+
name | Description
30+
-- | --
31+
\- | \-
32+
2733
### Avatar External Classes
2834

2935
className | Description
@@ -42,7 +48,7 @@ name | type | default | description | required
4248
style | Object | - | CSS(Cascading Style Sheets) | N
4349
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
4450
cascading | String | 'left-up' | multiple images cascading。options: left-up/right-up。Typescript:`CascadingValue` `type CascadingValue = 'left-up' \| 'right-up'`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/avatar-group/type.ts) | N
45-
collapse-avatar | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
51+
collapse-avatar | String | - | \- | N
4652
max | Number | - | \- | N
4753
shape | String | - | shape。options: circle/round。Typescript:`ShapeEnum`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
4854
size | String | - | size | N
@@ -53,6 +59,13 @@ name | params | description
5359
-- | -- | --
5460
collapsed-item-click | - | \-
5561

62+
### AvatarGroup Slots
63+
64+
name | Description
65+
-- | --
66+
\- | \-
67+
collapse-avatar | \-
68+
5669
### AvatarGroup External Classes
5770

5871
className | Description

packages/components/avatar/README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ size | String | - | 尺寸,示例值:small/medium/large/24px/38px 等。优
8484
-- | -- | --
8585
error | - | 图片加载失败时触发
8686

87+
### Avatar Slots
88+
89+
名称 | 描述
90+
-- | --
91+
\- | 默认插槽,自定义内容区域内容
92+
8793
### Avatar External Classes
8894

8995
类名 | 描述
@@ -102,7 +108,7 @@ t-class-image | 图片样式类
102108
style | Object | - | 样式 | N
103109
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
104110
cascading | String | 'left-up' | 图片之间的层叠关系,可选值:左侧图片在上和右侧图片在上。可选项:left-up/right-up。TS 类型:`CascadingValue` `type CascadingValue = 'left-up' \| 'right-up'`[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/avatar-group/type.ts) | N
105-
collapse-avatar | String / Slot | - | 头像数量超出时,会出现一个头像折叠元素。该元素内容可自定义。默认为 `+N`。示例:`+5``...`, `更多`[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
111+
collapse-avatar | String | - | 头像数量超出时,会出现一个头像折叠元素。该元素内容可自定义。默认为 `+N`。示例:`+5``...`, `更多` | N
106112
max | Number | - | 能够同时显示的最多头像数量 | N
107113
shape | String | - | 形状。优先级低于 Avatar.shape。可选项:circle/round。TS 类型:`ShapeEnum`[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
108114
size | String | - | 尺寸,示例值:small/medium/large/24px/38px 等。优先级低于 Avatar.size | N
@@ -113,6 +119,13 @@ size | String | - | 尺寸,示例值:small/medium/large/24px/38px 等。优
113119
-- | -- | --
114120
collapsed-item-click | - | 点击头像折叠元素触发
115121

122+
### AvatarGroup Slots
123+
124+
名称 | 描述
125+
-- | --
126+
\- | 默认插槽,自定义内容区域内容
127+
collapse-avatar | 自定义 `collapse-avatar` 显示内容
128+
116129
### AvatarGroup External Classes
117130

118131
类名 | 描述

packages/components/back-top/README.en-US.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name | type | default | description | required
99
style | Object | - | CSS(Cascading Style Sheets) | N
1010
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
1111
fixed | Boolean | true | \- | N
12-
icon | String / Boolean / Object / Slot | true | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
12+
icon | String / Boolean / Object | true | \- | N
1313
scroll-top | Number | 0 | \- | N
1414
text | String | '' | \- | N
1515
theme | String | round | options: round/half-round/round-dark/half-round-dark | N
@@ -21,6 +21,13 @@ name | params | description
2121
-- | -- | --
2222
to-top | \- | \-
2323

24+
### BackTop Slots
25+
26+
name | Description
27+
-- | --
28+
\- | \-
29+
icon | \-
30+
2431
### BackTop External Classes
2532

2633
className | Description

packages/components/back-top/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ isComponent: true
4040
style | Object | - | 样式 | N
4141
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
4242
fixed | Boolean | true | 是否绝对定位固定到屏幕右下方 | N
43-
icon | String / Boolean / Object / Slot | true | 图标。值为 `false` 表示不显示图标。不传表示使用默认图标 `'backtop'`[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
43+
icon | String / Boolean / Object | true | 图标。值为 `false` 表示不显示图标。不传表示使用默认图标 `'backtop'` | N
4444
scroll-top | Number | 0 | 页面滚动距离 | N
4545
text | String | '' | 文案 | N
4646
theme | String | round | 预设的样式类型。可选项:round/half-round/round-dark/half-round-dark | N
@@ -52,6 +52,13 @@ visibility-height | Number | 200 | 滚动高度达到此参数值才出现 | N
5252
-- | -- | --
5353
to-top | \- | 点击触发
5454

55+
### BackTop Slots
56+
57+
名称 | 描述
58+
-- | --
59+
\- | 默认插槽,自定义内容区域内容
60+
icon | 自定义图标内容
61+
5562
### BackTop External Classes
5663

5764
类名 | 描述

packages/components/badge/README.en-US.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,21 @@ style | Object | - | CSS(Cascading Style Sheets) | N
1010
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
1111
color | String | - | \- | N
1212
content | String | - | \- | N
13-
count | String / Number / Slot | 0 | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
13+
count | String / Number | 0 | \- | N
1414
dot | Boolean | false | \- | N
1515
max-count | Number | 99 | \- | N
1616
offset | Array | - | Typescript:`Array<string \| number>` | N
1717
shape | String | circle | options: circle/square/bubble/ribbon | N
1818
show-zero | Boolean | false | \- | N
1919
size | String | medium | options: medium/large | N
2020

21+
### Badge Slots
22+
23+
name | Description
24+
-- | --
25+
\- | \-
26+
count | \-
27+
2128
### Badge External Classes
2229

2330
className | Description

packages/components/badge/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,21 @@ style | Object | - | 样式 | N
5151
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
5252
color | String | - | 颜色 | N
5353
content | String | - | 徽标内容,示例:`content='自定义内容'`。也可以使用默认插槽定义 | N
54-
count | String / Number / Slot | 0 | 徽标右上角内容。可以是数字,也可以是文字。如:'new'/3/99+。特殊:值为空表示使用插槽渲染[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
54+
count | String / Number | 0 | 徽标右上角内容。可以是数字,也可以是文字。如:'new'/3/99+。特殊:值为空表示使用插槽渲染 | N
5555
dot | Boolean | false | 是否为红点 | N
5656
max-count | Number | 99 | 封顶的数字值 | N
5757
offset | Array | - | 设置状态点的位置偏移,示例:[-10, 20]['10em', '8rem']。TS 类型:`Array<string \| number>` | N
5858
shape | String | circle | 形状。可选项:circle/square/bubble/ribbon | N
5959
show-zero | Boolean | false | 当数值为 0 时,是否展示徽标 | N
6060
size | String | medium | 尺寸。可选项:medium/large | N
6161

62+
### Badge Slots
63+
64+
名称 | 描述
65+
-- | --
66+
\- | 默认插槽,自定义内容区域内容
67+
count | 徽标右上角内容
68+
6269
### Badge External Classes
6370

6471
类名 | 描述

packages/components/button/README.en-US.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ style | Object | - | CSS(Cascading Style Sheets) | N
7575
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
7676
app-parameter | String | - | \- | N
7777
block | Boolean | false | make button to be a block-level element | N
78-
content | String / Slot | - | button's children elements[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
78+
content | String | - | button's children elements | N
7979
custom-dataset | any | - | \- | N
8080
disabled | Boolean | undefined | disable the button, make it can not be clicked | N
8181
ghost | Boolean | false | make background-color to be transparent | N
@@ -96,7 +96,6 @@ session-from | String | - | \- | N
9696
shape | String | rectangle | button shape。options: rectangle/square/round/circle | N
9797
show-message-card | Boolean | false | \- | N
9898
size | String | medium | a button has four size。options: extra-small/small/medium/large | N
99-
suffix | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
10099
t-id | String | - | id | N
101100
theme | String | default | button theme。options: default/primary/danger/light | N
102101
type | String | - | type of button element, same as formType of Miniprogram。options: submit/reset | N
@@ -119,6 +118,14 @@ launchapp | \- | \-
119118
opensetting | \- | \-
120119
tap | `event` | \-
121120

121+
### Button Slots
122+
123+
name | Description
124+
-- | --
125+
\- | \-
126+
content | button's children elements
127+
suffix | \-
128+
122129
### Button External Classes
123130

124131
className | Description

packages/components/button/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ style | Object | - | 样式 | N
7777
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
7878
app-parameter | String | - | 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效 | N
7979
block | Boolean | false | 是否为块级元素 | N
80-
content | String / Slot | - | 按钮内容[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
80+
content | String | - | 按钮内容 | N
8181
custom-dataset | any | - | 自定义 dataset,可通过 event.currentTarget.dataset.custom 获取 | N
8282
disabled | Boolean | undefined | 禁用状态。优先级:Button.disabled > Form.disabled | N
8383
ghost | Boolean | false | 是否为幽灵按钮(镂空按钮) | N
@@ -98,7 +98,6 @@ session-from | String | - | 会话来源,open-type="contact"时有效 | N
9898
shape | String | rectangle | 按钮形状,有 4 种:长方形、正方形、圆角长方形、圆形。可选项:rectangle/square/round/circle | N
9999
show-message-card | Boolean | false | 是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,open-type="contact"时有效 | N
100100
size | String | medium | 组件尺寸。可选项:extra-small/small/medium/large | N
101-
suffix | Slot | - | 右侧内容,可用于定义右侧图标。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
102101
t-id | String | - | 按钮标签id | N
103102
theme | String | default | 组件风格,依次为品牌色、危险色。可选项:default/primary/danger/light | N
104103
type | String | - | 同小程序的 formType。可选项:submit/reset | N
@@ -121,6 +120,14 @@ launchapp | \- | 打开 APP 成功的回调,`open-type=launchApp` 时有效
121120
opensetting | \- | 原生按钮属性,在打开授权设置页后回调,open-type=openSetting时有效
122121
tap | `event` | 点击按钮,当按钮不为加载或禁用状态时触发
123122

123+
### Button Slots
124+
125+
名称 | 描述
126+
-- | --
127+
\- | 默认插槽,作用同 `content` 插槽
128+
content | 自定义 `content` 显示内容
129+
suffix | 右侧内容,可用于定义右侧图标
130+
124131
### Button External Classes
125132

126133
类名 | 描述

0 commit comments

Comments
 (0)