Skip to content

Commit

Permalink
docs(steps): sync api
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Nov 15, 2024
1 parent 5b7ee88 commit 784622e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
9 changes: 6 additions & 3 deletions src/steps/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export default {
/** 当前步骤,即整个步骤条进度。默认根据步骤下标判断步骤的完成状态,当前步骤为进行中,当前步骤之前的步骤为已完成,当前步骤之后的步骤为未开始。如果每个步骤没有设置 value,current 值为步骤长度则表示所有步骤已完成。如果每个步骤设置了自定义 value,则 current = 'FINISH' 表示所有状态完成 */
current: {
type: [String, Number] as PropType<TdStepsProps['current']>,
default: undefined,
default: undefined as TdStepsProps['current'],
},
modelValue: {
type: [String, Number] as PropType<TdStepsProps['current']>,
default: undefined,
default: undefined as TdStepsProps['current'],
},
/** 当前步骤,即整个步骤条进度。默认根据步骤下标判断步骤的完成状态,当前步骤为进行中,当前步骤之前的步骤为已完成,当前步骤之后的步骤为未开始。如果每个步骤没有设置 value,current 值为步骤长度则表示所有步骤已完成。如果每个步骤设置了自定义 value,则 current = 'FINISH' 表示所有状态完成,非受控属性 */
defaultCurrent: {
Expand All @@ -35,7 +35,10 @@ export default {
type: Array as PropType<TdStepsProps['options']>,
},
/** 只读状态 */
readonly: Boolean,
readonly: {
type: Boolean,
default: undefined,
},
/** 步骤条分割符 */
separator: {
type: String as PropType<TdStepsProps['separator']>,
Expand Down
8 changes: 4 additions & 4 deletions src/steps/step-item-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
/** 步骤描述 */
content: {
type: [String, Function] as PropType<TdStepItemProps['content']>,
default: '',
default: '' as TdStepItemProps['content'],
},
/** 步骤描述,同 content */
default: {
Expand All @@ -24,9 +24,9 @@ export default {
/** 图标,默认显示内置图标,也可以自定义图标,值为 false 则不显示图标。优先级大于 `status` 定义的图标 */
icon: {
type: [Boolean, Function] as PropType<TdStepItemProps['icon']>,
default: true,
default: true as TdStepItemProps['icon'],
},
/** 当前步骤的状态 */
/** 当前步骤的状态:默认状态(未开始)、进行中状态、完成状态、错误状态 */
status: {
type: String as PropType<TdStepItemProps['status']>,
default: 'default' as TdStepItemProps['status'],
Expand All @@ -38,7 +38,7 @@ export default {
/** 标题 */
title: {
type: [String, Function] as PropType<TdStepItemProps['title']>,
default: '',
default: '' as TdStepItemProps['title'],
},
/** 当前步骤标识 */
value: {
Expand Down
13 changes: 7 additions & 6 deletions src/steps/steps.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ name | type | default | description | required
-- | -- | -- | -- | --
current | String / Number | - | `v-model` and `v-model:current` is supported | N
defaultCurrent | String / Number | - | uncontrolled property | N
layout | String | horizontal | optionshorizontal/vertical | N
layout | String | horizontal | options: horizontal/vertical | N
options | Array | - | Typescript:`Array<TdStepItemProps>` | N
readonly | Boolean | false | \- | N
separator | String | line | optionsline/dashed/arrow | N
sequence | String | positive | optionspositive/reverse | N
theme | String | default | optionsdefault/dot | N
readonly | Boolean | undefined | \- | N
separator | String | line | options: line/dashed/arrow | N
sequence | String | positive | options: positive/reverse | N
theme | String | default | options: default/dot | N
onChange | Function | | Typescript:`(current: string \| number, previous: string \| number, context?: { e?: MouseEvent }) => void`<br/> | N

### Steps Events
Expand All @@ -22,6 +22,7 @@ name | params | description
-- | -- | --
change | `(current: string \| number, previous: string \| number, context?: { e?: MouseEvent })` | \-


### StepItem Props

name | type | default | description | required
Expand All @@ -30,6 +31,6 @@ content | String / Slot / Function | '' | Typescript:`string \| TNode`。[see
default | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
extra | String / Slot / Function | - | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
icon | Boolean / Slot / Function | true | Typescript:`boolean \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
status | String | default | optionsdefault/process/finish/error。Typescript:`StepStatus` `type StepStatus = 'default' \| 'process' \| 'finish' \| 'error'`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/steps/type.ts) | N
status | String | default | options: default/process/finish/error。Typescript:`StepStatus` `type StepStatus = 'default' \| 'process' \| 'finish' \| 'error'`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/tree/develop/src/steps/type.ts) | N
title | String / Slot / Function | '' | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
value | String / Number | - | \- | N
8 changes: 5 additions & 3 deletions src/steps/steps.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
:: BASE_DOC ::

## API

### Steps Props

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
current | String / Number | - | 当前步骤,即整个步骤条进度。默认根据步骤下标判断步骤的完成状态,当前步骤为进行中,当前步骤之前的步骤为已完成,当前步骤之后的步骤为未开始。如果每个步骤没有设置 value,current 值为步骤长度则表示所有步骤已完成。如果每个步骤设置了自定义 value,则 current = 'FINISH' 表示所有状态完成。支持语法糖 `v-model``v-model:current` | N
defaultCurrent | String / Number | - | 当前步骤,即整个步骤条进度。默认根据步骤下标判断步骤的完成状态,当前步骤为进行中,当前步骤之前的步骤为已完成,当前步骤之后的步骤为未开始。如果每个步骤没有设置 value,current 值为步骤长度则表示所有步骤已完成。如果每个步骤设置了自定义 value,则 current = 'FINISH' 表示所有状态完成。非受控属性 | N
layout | String | horizontal | 步骤条方向,有两种:横向和纵向。可选项:horizontal/vertical | N
options | Array | - | 步骤条数据列表(作用和 StepItem 效果一样)。TS 类型:`Array<TdStepItemProps>` | N
readonly | Boolean | false | 只读状态 | N
readonly | Boolean | undefined | 只读状态 | N
separator | String | line | 步骤条分割符。可选项:line/dashed/arrow | N
sequence | String | positive | 步骤条顺序。可选项:positive/reverse | N
theme | String | default | 步骤条风格。可选项:default/dot | N
Expand All @@ -21,9 +22,10 @@ onChange | Function | | TS 类型:`(current: string \| number, previous: stri
-- | -- | --
change | `(current: string \| number, previous: string \| number, context?: { e?: MouseEvent })` | 当前步骤发生变化时触发


### StepItem Props

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
content | String / Slot / Function | '' | 步骤描述。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
default | String / Slot / Function | - | 步骤描述,同 content。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue-next/blob/develop/src/common.ts) | N
Expand Down
3 changes: 1 addition & 2 deletions src/steps/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export interface TdStepsProps {
options?: Array<TdStepItemProps>;
/**
* 只读状态
* @default false
*/
readonly?: boolean;
/**
Expand Down Expand Up @@ -74,7 +73,7 @@ export interface TdStepItemProps {
*/
icon?: boolean | TNode;
/**
* 当前步骤的状态
* 当前步骤的状态:默认状态(未开始)、进行中状态、完成状态、错误状态
* @default default
*/
status?: StepStatus;
Expand Down

0 comments on commit 784622e

Please sign in to comment.