Skip to content

Commit

Permalink
docs(Tabs): sync api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao committed Sep 3, 2024
1 parent 95dafe0 commit 96690f8
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 25 deletions.
3 changes: 1 addition & 2 deletions src/tab-panel/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const props: TdTabPanelProps = {
/** 透传至 Badge 组件 */
badgeProps: {
type: Object,
value: null,
},
/** 【实现有误,暂不支持】选项卡内容隐藏时是否销毁 */
destroyOnHide: {
Expand All @@ -21,7 +20,7 @@ const props: TdTabPanelProps = {
type: Boolean,
value: false,
},
/** 图标,传对象则透传至 Icon */
/** `1.0.0-rc.1`。图标,传对象则透传至 Icon */
icon: {
type: null,
},
Expand Down
3 changes: 1 addition & 2 deletions src/tab-panel/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { TabValue } from '../tabs/index';
export interface TdTabPanelProps {
/**
* 透传至 Badge 组件
* @default null
*/
badgeProps?: {
type: ObjectConstructor;
Expand All @@ -32,7 +31,7 @@ export interface TdTabPanelProps {
value?: boolean;
};
/**
* 图标,传对象则透传至 Icon
* `1.0.0-rc.1`。图标,传对象则透传至 Icon
*/
icon?: {
type: null;
Expand Down
29 changes: 21 additions & 8 deletions src/tabs/README.en-US.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
:: BASE_DOC ::

## API

### Tabs Props

name | type | default | description | required
-- | -- | -- | -- | --
style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
animation | Object | - | Typescript:`TabAnimation` `type TabAnimation = { duration: number } & Record<string, any>`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
external-classes | Array | - | `['t-class', 't-class-item', 't-class-active', 't-class-track']` | N
middle | Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
show-bottom-line | Boolean | true | \- | N
space-evenly | Boolean | true | \- | N
split | Boolean | true | `1.1.10` | N
split | Boolean | true | \- | N
sticky | Boolean | false | \- | N
sticky-props | Object | - | Typescript:`StickyProps`[Sticky API Documents](./sticky?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
swipeable | Boolean | true | \- | N
theme | String | line | optionsline/tag/card | N
theme | String | line | options: line/tag/card | N
value | String / Number | - | Typescript:`TabValue` `type TabValue = string \| number`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
default-value | String / Number | undefined | uncontrolled property。Typescript:`TabValue` `type TabValue = string \| number`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N

Expand All @@ -25,22 +27,33 @@ name | params | description
change | `(value: TabValue, label: string)` | \-
click | `(value: TabValue, label: string)` | \-
scroll | `(scrollTop: number, isFixed: boolean)` | \-
### Tabs External Classes

className | Description
-- | --
t-class | \-
t-class-active | \-
t-class-content | \-
t-class-item | \-
t-class-track | \-


### TabPanel Props

name | type | default | description | required
-- | -- | -- | -- | --
badge-props | Object | null | \- | N
style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
badge-props | Object | - | \- | N
destroy-on-hide | Boolean | true | \- | N
disabled | Boolean | false | \- | N
icon | String / Object | - | `1.0.0-rc.1` | N
icon | String / Object | - | \- | N
label | String | - | \- | N
panel | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
value | String / Number | - | Typescript:`TabValue`[Tabs API Documents](./tabs?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tab-panel/type.ts) | N



### CSS Variables

The component provides the following CSS variables, which can be used to customize styles.
Name | Default Value | Description
-- | -- | --
Expand All @@ -60,4 +73,4 @@ Name | Default Value | Description
--td-tab-track-color | @brand-color | -
--td-tab-track-radius | 8rpx | -
--td-tab-track-thickness | 6rpx | -
--td-tab-track-width | 32rpx | -
--td-tab-track-width | 32rpx | -
27 changes: 16 additions & 11 deletions src/tabs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,13 @@ Page({
```

## API

### Tabs Props

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
animation | Object | - | 动画效果设置。其中 duration 表示动画时长。(单位:秒)。TS 类型:`TabAnimation` `type TabAnimation = { duration: number } & Record<string, any>`[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tabs/type.ts) | N
middle | Slot | - | 中间内容,介于头部和内容之间。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
show-bottom-line | Boolean | true | 是否展示底部激活线条 | N
Expand All @@ -137,31 +140,33 @@ default-value | String / Number | undefined | 激活的选项卡值。非受控
change | `(value: TabValue, label: string)` | 激活的选项卡发生变化时触发
click | `(value: TabValue, label: string)` | 点击选项卡时触发
scroll | `(scrollTop: number, isFixed: boolean)` | 页面滚动时触发
### Tabs External Classes

### Tabs 外部样式类
类名 | 说明
-- | --
类名 | 描述
-- | --
t-class | 根节点样式类
t-class-item | 选项样式类
t-class-active | 激活态样式类
t-class-track | 滚动条样式类
t-class-content | 内容样式类
t-class-item | 选项样式类
t-class-track | 滚动条样式类


### TabPanel Props

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
badge-props | Object | null | 透传至 Badge 组件 | N
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
badge-props | Object | - | 透传至 Badge 组件 | N
destroy-on-hide | Boolean | true | 【实现有误,暂不支持】选项卡内容隐藏时是否销毁 | N
disabled | Boolean | false | 是否禁用当前选项卡 | N
icon | String / Object | - | `1.0.0-rc.1`。图标,传对象则透传至 Icon | N
label | String | - | 选项卡名称 | N
panel | String / Slot | - | 用于自定义选项卡面板内容。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
value | String / Number | - | 选项卡的值,唯一标识。TS 类型:`TabValue`[Tabs API Documents](./tabs?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/tab-panel/type.ts) | N

### CSS Variables


### CSS 变量
组件提供了下列 CSS 变量,可用于自定义样式。
名称 | 默认值 | 描述
-- | -- | --
Expand All @@ -181,4 +186,4 @@ value | String / Number | - | 选项卡的值,唯一标识。TS 类型:`TabV
--td-tab-track-color | @brand-color | -
--td-tab-track-radius | 8rpx | -
--td-tab-track-thickness | 6rpx | -
--td-tab-track-width | 32rpx | -
--td-tab-track-width | 32rpx | -
2 changes: 1 addition & 1 deletion src/tabs/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const props: TdTabsProps = {
type: Boolean,
value: true,
},
/** 是否展示分割线 */
/** `1.1.10`。是否展示分割线 */
split: {
type: Boolean,
value: true,
Expand Down
2 changes: 1 addition & 1 deletion src/tabs/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface TdTabsProps {
value?: boolean;
};
/**
* 是否展示分割线
* `1.1.10`。是否展示分割线
* @default true
*/
split?: {
Expand Down

0 comments on commit 96690f8

Please sign in to comment.