Skip to content

Commit

Permalink
docs: sync api
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Jul 23, 2024
1 parent 7f1171a commit aeeb733
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/progress/progress.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ color | String / Object / Array | '' | Typescript:`string \| Array<string> \|
label | String / Boolean / Slot / Function | true | Typescript:`string \| boolean \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
percentage | Number | 0 | \- | N
size | String / Number | 'medium' | \- | N
status | String | - | optionssuccess/error/warning/active。Typescript:`StatusEnum` `type StatusEnum = 'success' \| 'error' \| 'warning' \| 'active'`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/progress/type.ts) | N
status | String | - | options: success/error/warning/active。Typescript:`ProgressStatus` `type ProgressStatus = 'success' \| 'error' \| 'warning' \| 'active'`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/progress/type.ts) | N
strokeWidth | String / Number | - | \- | N
theme | String | line | optionsline/plump/circle。Typescript:`ThemeEnum` `type ThemeEnum = 'line' \| 'plump' \| 'circle'`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/progress/type.ts) | N
theme | String | line | options: line/plump/circle。Typescript:`ProgressTheme` `type ProgressTheme = 'line' \| 'plump' \| 'circle'`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/progress/type.ts) | N
trackColor | String | '' | \- | N
7 changes: 4 additions & 3 deletions src/progress/progress.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
:: BASE_DOC ::

## API

### Progress Props

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
color | String / Object / Array | '' | 进度条颜色。示例:'#ED7B2F' 或 'orange' 或 `['#f00', '#0ff', '#f0f']``{ '0%': '#f00', '100%': '#0ff' }``{ from: '#000', to: '#000' }` 等。TS 类型:`string \| Array<string> \| Record<string, string>` | N
label | String / Boolean / Slot / Function | true | 进度百分比,可自定义。TS 类型:`string \| boolean \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
percentage | Number | 0 | 进度条百分比 | N
size | String / Number | 'medium' | 进度条尺寸,示例:small/medium/large/240。small 值为 72; medium 值为 112;large 值为 160 | N
status | String | - | 进度条状态。可选项:success/error/warning/active。TS 类型:`StatusEnum` `type StatusEnum = 'success' \| 'error' \| 'warning' \| 'active'`[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/progress/type.ts) | N
status | String | - | 进度条状态。可选项:success/error/warning/active。TS 类型:`ProgressStatus` `type ProgressStatus = 'success' \| 'error' \| 'warning' \| 'active'`[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/progress/type.ts) | N
strokeWidth | String / Number | - | 进度条线宽。宽度数值不能超过 size 的一半,否则不能输出环形进度 | N
theme | String | line | 进度条风格。值为 line,标签(label)显示在进度条右侧;值为 plump,标签(label)显示在进度条里面;值为 circle,标签(label)显示在进度条正中间。可选项:line/plump/circle。TS 类型:`ThemeEnum` `type ThemeEnum = 'line' \| 'plump' \| 'circle'`[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/progress/type.ts) | N
theme | String | line | 进度条风格。值为 line,标签(label)显示在进度条右侧;值为 plump,标签(label)显示在进度条里面;值为 circle,标签(label)显示在进度条正中间。可选项:line/plump/circle。TS 类型:`ProgressTheme` `type ProgressTheme = 'line' \| 'plump' \| 'circle'`[详细类型定义](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/progress/type.ts) | N
trackColor | String | '' | 进度条未完成部分颜色 | N
7 changes: 4 additions & 3 deletions src/progress/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* updated at 2021-12-12 19:17:30
* */

import { TdProgressProps } from './type';
Expand All @@ -17,7 +16,7 @@ export default {
/** 进度百分比,可自定义 */
label: {
type: [String, Boolean, Function] as PropType<TdProgressProps['label']>,
default: true,
default: true as TdProgressProps['label'],
},
/** 进度条百分比 */
percentage: {
Expand All @@ -27,12 +26,13 @@ export default {
/** 进度条尺寸,示例:small/medium/large/240。small 值为 72; medium 值为 112;large 值为 160 */
size: {
type: [String, Number] as PropType<TdProgressProps['size']>,
default: 'medium',
default: 'medium' as TdProgressProps['size'],
},
/** 进度条状态 */
status: {
type: String as PropType<TdProgressProps['status']>,
validator(val: TdProgressProps['status']): boolean {
if (!val) return true;
return ['success', 'error', 'warning', 'active'].includes(val);
},
},
Expand All @@ -45,6 +45,7 @@ export default {
type: String as PropType<TdProgressProps['theme']>,
default: 'line' as TdProgressProps['theme'],
validator(val: TdProgressProps['theme']): boolean {
if (!val) return true;
return ['line', 'plump', 'circle'].includes(val);
},
},
Expand Down
9 changes: 4 additions & 5 deletions src/progress/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* updated at 2021-12-12 19:17:30
* */

import { TNode } from '../common';
Expand Down Expand Up @@ -31,7 +30,7 @@ export interface TdProgressProps {
/**
* 进度条状态
*/
status?: StatusEnum;
status?: ProgressStatus;
/**
* 进度条线宽。宽度数值不能超过 size 的一半,否则不能输出环形进度
*/
Expand All @@ -40,14 +39,14 @@ export interface TdProgressProps {
* 进度条风格。值为 line,标签(label)显示在进度条右侧;值为 plump,标签(label)显示在进度条里面;值为 circle,标签(label)显示在进度条正中间
* @default line
*/
theme?: ThemeEnum;
theme?: ProgressTheme;
/**
* 进度条未完成部分颜色
* @default ''
*/
trackColor?: string;
}

export type StatusEnum = 'success' | 'error' | 'warning' | 'active';
export type ProgressStatus = 'success' | 'error' | 'warning' | 'active';

export type ThemeEnum = 'line' | 'plump' | 'circle';
export type ProgressTheme = 'line' | 'plump' | 'circle';

0 comments on commit aeeb733

Please sign in to comment.