Skip to content

Commit

Permalink
docs(result): sync api (#2685)
Browse files Browse the repository at this point in the history
* docs(result): sync api

* docs(result): sync api
  • Loading branch information
liweijie0812 authored Apr 9, 2024
1 parent bae8855 commit cb9900b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 41 deletions.
25 changes: 17 additions & 8 deletions src/result/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,24 @@

name | type | default | description | required
-- | -- | -- | -- | --
description | String / Slot | - | \- | N
external-classes | Array | - | \- | N
icon | String | - | \- | N
image | String / Slot | - | \- | N
theme | String | default | \- | N
title | String / Slot | '' | \- | N
style | Object | - | CSS(Cascading Style Sheets) | N
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
description | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
icon | String / Boolean / Object | true | \- | N
image | String / Slot | - | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
theme | String | default | options: default/success/warning/error | N
title | String / Slot | '' | [see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
### Result External Classes

className | Description
-- | --
t-class | \-
t-class-description | \-
t-class-image | \-
t-class-title | \-

### CSS 变量

### CSS Variables
The component provides the following CSS variables, which can be used to customize styles.
Name | Default Value | Description
-- | -- | --
Expand All @@ -29,4 +38,4 @@ Name | Default Value | Description
--td-result-title-color | @font-gray-1 | -
--td-result-title-font-size | @font-size-l | -
--td-result-title-line-height | 56rpx | -
--td-result-title-margin-top | @spacer-1 | -
--td-result-title-margin-top | @spacer-1 | -
22 changes: 13 additions & 9 deletions src/result/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,29 @@ isComponent: true
</details>

## API

### Result Props

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
description | String / Slot | - | 描述文字 | N
style | Object | - | 样式 | N
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
description | String / Slot | - | 描述文字。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
icon | String / Boolean / Object | true | 图标名称。值为字符串表示图标名称,值为 `false` 表示不显示图标,值为 `Object` 类型,表示透传至 `icon`,不传表示使用主题图标。 | N
image | String / Slot | - | 图片地址 | N
image | String / Slot | - | 图片地址[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
theme | String | default | 内置主题。可选项:default/success/warning/error | N
title | String / Slot | '' | 标题 | N
title | String / Slot | '' | 标题。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/common/common.ts) | N
### Result External Classes

### Result 外部样式类
类名 | 说明
-- | --
类名 | 描述
-- | --
t-class | 根节点样式类
t-class-description | 描述样式类
t-class-image | 图片样式类
t-class-title | 标题样式类
t-class-description | 描述样式类

### CSS 变量

组件提供了下列 CSS 变量,可用于自定义样式。
名称 | 默认值 | 描述
-- | -- | --
Expand All @@ -86,4 +90,4 @@ t-class-description | 描述样式类
--td-result-title-color | @font-gray-1 | -
--td-result-title-font-size | @font-size-l | -
--td-result-title-line-height | 56rpx | -
--td-result-title-margin-top | @spacer-1 | -
--td-result-title-margin-top | @spacer-1 | -
8 changes: 2 additions & 6 deletions src/result/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ const props: TdResultProps = {
description: {
type: String,
},
/** 组件类名,分别用于设置 组件外层类名、文本描述类名、图片类名、操作按钮类名。`['t-class', 't-class-image', 't-class-title', 't-class-description']` */
externalClasses: {
type: Array,
},
/** 图标名称 */
/** 图标名称。值为字符串表示图标名称,值为 `false` 表示不显示图标,值为 `Object` 类型,表示透传至 `icon`,不传表示使用主题图标。 */
icon: {
type: null,
value: true,
Expand All @@ -23,7 +19,7 @@ const props: TdResultProps = {
image: {
type: String,
},
/** 内置主题。可选项:default/success/warning/error */
/** 内置主题 */
theme: {
type: String,
value: 'default',
Expand Down
21 changes: 3 additions & 18 deletions src/result/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
* */

export interface TdResultProps {
/**
* 自定义组件样式
* @default ''
*/
style?: {
type: StringConstructor;
value?: string;
};
/**
* 描述文字
*/
Expand All @@ -21,19 +13,12 @@ export interface TdResultProps {
value?: string;
};
/**
* 组件类名,分别用于设置 组件外层类名、文本描述类名、图片类名、操作按钮类名。`['t-class', 't-class-image', 't-class-title', 't-class-description']`
*/
externalClasses?: {
type: ArrayConstructor;
value?: ['t-class', 't-class-description', 't-class-image'];
};
/**
* 图标名称
* 图标名称。值为字符串表示图标名称,值为 `false` 表示不显示图标,值为 `Object` 类型,表示透传至 `icon`,不传表示使用主题图标。
* @default true
*/
icon?: {
type: null;
value?: boolean | string | object;
value?: string | boolean | object;
};
/**
* 图片地址
Expand All @@ -43,7 +28,7 @@ export interface TdResultProps {
value?: string;
};
/**
* 内置主题。可选项:default/success/warning/error
* 内置主题
* @default default
*/
theme?: {
Expand Down

0 comments on commit cb9900b

Please sign in to comment.