Skip to content

Commit

Permalink
feat(steps): update api (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao authored Sep 7, 2023
1 parent 2644b69 commit d6a68c1
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
Binary file modified db/TDesign.db
Binary file not shown.
34 changes: 34 additions & 0 deletions packages/products/tdesign-mobile-vue/src/steps/steps.en-US.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
:: BASE_DOC ::

## API

### Steps Props

name | type | default | description | required
-- | -- | -- | -- | --
current | String / Number | - | `v-model` and `v-model:current` is supported | N
defaultCurrent | String / Number | - | uncontrolled property | N
currentStatus | String | process | options: default/process/finish/error | N
layout | String | horizontal | options: horizontal/vertical | N
options | Array | - | Typescript:`Array<TdStepItemProps>` | N
readonly | Boolean | false | \- | 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

name | params | description
-- | -- | --
change | `(current: string \| number, previous: string \| number, context?: { e?: MouseEvent })` | \-

### StepItem Props

name | type | default | description | required
-- | -- | -- | -- | --
content | String / Slot / Function | '' | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
icon | Boolean / Slot / Function | true | Typescript:`boolean \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.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-mobile-vue/tree/develop/src/steps/type.ts) | N
subStepItems | Array | [] | Typescript:`SubStepItem[]` `interface SubStepItem { status: StepStatus, title: string }`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/steps/type.ts) | N
title | String / Slot / Function | '' | Typescript:`string \| TNode`[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
34 changes: 34 additions & 0 deletions packages/products/tdesign-mobile-vue/src/steps/steps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
:: 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
currentStatus | String | process | 用于控制 current 指向的步骤条的状态。可选项:default/process/finish/error | N
layout | String | horizontal | 步骤条方向,有两种:横向和纵向。可选项:horizontal/vertical | N
options | Array | - | 步骤条数据列表(作用和 StepItem 效果一样)。TS 类型:`Array<TdStepItemProps>` | N
readonly | Boolean | false | 只读状态 | N
separator | String | line | 步骤条分割符。可选项:line/dashed/arrow | N
sequence | String | positive | 步骤条顺序。可选项:positive/reverse | N
theme | String | default | 步骤条风格。可选项:default/dot | N
onChange | Function | | TS 类型:`(current: string \| number, previous: string \| number, context?: { e?: MouseEvent }) => void`<br/>当前步骤发生变化时触发 | N

### Steps Events

名称 | 参数 | 描述
-- | -- | --
change | `(current: string \| number, previous: string \| number, context?: { e?: MouseEvent })` | 当前步骤发生变化时触发

### StepItem Props

名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
content | String / Slot / Function | '' | 步骤描述。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
icon | Boolean / Slot / Function | true | 图标,默认显示内置图标,也可以自定义图标,值为 false 则不显示图标。优先级大于 `status` 定义的图标。TS 类型:`boolean \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
status | String | default | 当前步骤的状态:默认状态(未开始)、进行中状态、完成状态、错误状态。可选项:default/process/finish/error。TS 类型:`StepStatus` `type StepStatus = 'default' \| 'process' \| 'finish' \| 'error'`[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/steps/type.ts) | N
subStepItems | Array | [] | 子步骤条,仅支持 layout = 'vertical' 时。TS 类型:`SubStepItem[]` `interface SubStepItem { status: StepStatus, title: string }`[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/steps/type.ts) | N
title | String / Slot / Function | '' | 标题。TS 类型:`string \| TNode`[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
12 changes: 12 additions & 0 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -87317,6 +87317,9 @@
{
"id": 2475,
"platform_framework": [
"8",
"16",
"32",
"64"
],
"component": "StepItem",
Expand Down Expand Up @@ -87345,6 +87348,9 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Angular(Mobile)",
"Miniprogram"
],
"field_type_text": [
Expand Down Expand Up @@ -88204,6 +88210,9 @@
{
"id": 2476,
"platform_framework": [
"8",
"16",
"32",
"64"
],
"component": "Steps",
Expand Down Expand Up @@ -88232,6 +88241,9 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)",
"Angular(Mobile)",
"Miniprogram"
],
"field_type_text": [
Expand Down

0 comments on commit d6a68c1

Please sign in to comment.