2016-03-31 14:17:09 +08:00
|
|
|
|
---
|
|
|
|
|
category: Components
|
2016-09-21 11:28:38 +08:00
|
|
|
|
subtitle: 步骤条
|
2022-11-09 12:28:04 +08:00
|
|
|
|
group: 导航
|
2016-09-21 11:28:38 +08:00
|
|
|
|
title: Steps
|
2022-11-30 20:14:41 +08:00
|
|
|
|
cover: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*677sTqCpE3wAAAAAAAAAAAAADrJ8AQ/original
|
2023-02-09 22:17:31 +08:00
|
|
|
|
coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*cFsBQLA0b7UAAAAAAAAAAAAADrJ8AQ/original
|
2016-03-31 14:17:09 +08:00
|
|
|
|
---
|
2015-06-15 22:01:39 +08:00
|
|
|
|
|
2015-06-26 14:42:30 +08:00
|
|
|
|
引导用户按照流程完成任务的导航条。
|
2015-06-24 14:52:49 +08:00
|
|
|
|
|
|
|
|
|
## 何时使用
|
|
|
|
|
|
2015-06-26 14:42:30 +08:00
|
|
|
|
当任务复杂或者存在先后关系时,将其分解成一系列步骤,从而简化任务。
|
2015-06-24 14:52:49 +08:00
|
|
|
|
|
2022-11-09 12:28:04 +08:00
|
|
|
|
## 代码演示
|
|
|
|
|
|
2022-11-17 17:31:26 +08:00
|
|
|
|
<!-- prettier-ignore -->
|
2022-11-10 19:46:44 +08:00
|
|
|
|
<code src="./demo/simple.tsx">基本用法</code>
|
|
|
|
|
<code src="./demo/small-size.tsx">迷你版</code>
|
|
|
|
|
<code src="./demo/icon.tsx">带图标的步骤条</code>
|
|
|
|
|
<code src="./demo/step-next.tsx">步骤切换</code>
|
|
|
|
|
<code src="./demo/vertical.tsx">竖直方向的步骤条</code>
|
|
|
|
|
<code src="./demo/vertical-small.tsx">竖直方向的小型步骤条</code>
|
|
|
|
|
<code src="./demo/error.tsx">步骤运行错误</code>
|
|
|
|
|
<code src="./demo/progress-dot.tsx">点状步骤条</code>
|
|
|
|
|
<code src="./demo/customized-progress-dot.tsx">自定义点状步骤条</code>
|
|
|
|
|
<code src="./demo/progress-dot-small.tsx" debug>迷你版点状步骤条</code>
|
|
|
|
|
<code src="./demo/clickable.tsx">可点击</code>
|
|
|
|
|
<code src="./demo/nav.tsx">导航步骤</code>
|
|
|
|
|
<code src="./demo/progress.tsx">带有进度的步骤</code>
|
|
|
|
|
<code src="./demo/label-placement.tsx">标签放置位置</code>
|
2022-11-09 12:28:04 +08:00
|
|
|
|
<code src="./demo/progress-debug.tsx" debug>Progress Debug</code>
|
2022-11-10 19:46:44 +08:00
|
|
|
|
<code src="./demo/steps-in-steps.tsx" debug>Steps 嵌套 Steps</code>
|
|
|
|
|
<code src="./demo/inline.tsx">内联步骤</code>
|
2022-12-06 23:14:30 +08:00
|
|
|
|
<code src="./demo/wireframe.tsx" debug>线框风格</code>
|
2022-11-09 12:28:04 +08:00
|
|
|
|
|
2022-10-30 17:17:47 +08:00
|
|
|
|
## API
|
|
|
|
|
|
2015-06-25 19:32:06 +08:00
|
|
|
|
### Steps
|
|
|
|
|
|
2015-07-17 09:42:09 +08:00
|
|
|
|
整体步骤条。
|
2015-06-25 19:32:06 +08:00
|
|
|
|
|
2022-11-17 17:31:26 +08:00
|
|
|
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
|
|
|
| --- | --- | --- | --- | --- |
|
|
|
|
|
| className | 步骤条类名 | string | - | |
|
|
|
|
|
| current | 指定当前步骤,从 0 开始记数。在子 Step 元素中,可以通过 `status` 属性覆盖状态 | number | 0 | |
|
|
|
|
|
| direction | 指定步骤条方向。目前支持水平(`horizontal`)和竖直(`vertical`)两种方向 | string | `horizontal` | |
|
|
|
|
|
| initial | 起始序号,从 0 开始记数 | number | 0 | |
|
|
|
|
|
| labelPlacement | 指定标签放置位置,默认水平放图标右侧,可选 `vertical` 放图标下方 | string | `horizontal` | |
|
|
|
|
|
| percent | 当前 `process` 步骤显示的进度条进度(只对基本类型的 Steps 生效) | number | - | 4.5.0 |
|
|
|
|
|
| progressDot | 点状步骤条,可以设置为一个 function,labelPlacement 将强制为 `vertical` | boolean \| (iconDot, {index, status, title, description}) => ReactNode | false | |
|
|
|
|
|
| responsive | 当屏幕宽度小于 `532px` 时自动变为垂直模式 | boolean | true | |
|
|
|
|
|
| size | 指定大小,目前支持普通(`default`)和迷你(`small`) | string | `default` | |
|
|
|
|
|
| status | 指定当前步骤的状态,可选 `wait` `process` `finish` `error` | string | `process` | |
|
|
|
|
|
| type | 步骤条类型,可选 `default` `navigation` `inline` | string | `default` | inline: 5.0 |
|
|
|
|
|
| onChange | 点击切换步骤时触发 | (current) => void | - | |
|
2022-12-22 14:12:26 +08:00
|
|
|
|
| items | 配置选项卡内容 | [StepItem](#stepitem) | [] | 4.24.0 |
|
2015-06-25 19:32:06 +08:00
|
|
|
|
|
2022-11-08 15:57:28 +08:00
|
|
|
|
### `type="inline"`
|
|
|
|
|
|
2022-11-17 17:31:26 +08:00
|
|
|
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
|
|
|
| --- | --- | --- | --- | --- |
|
|
|
|
|
| className | 步骤条类名 | string | - | |
|
|
|
|
|
| current | 指定当前步骤,从 0 开始记数。在子 Step 元素中,可以通过 `status` 属性覆盖状态 | number | 0 | |
|
|
|
|
|
| initial | 起始序号,从 0 开始记数 | number | 0 | |
|
|
|
|
|
| status | 指定当前步骤的状态,可选 `wait` `process` `finish` `error` | string | `process` | |
|
|
|
|
|
| onChange | 点击切换步骤时触发 | (current) => void | - | |
|
2022-12-22 14:12:26 +08:00
|
|
|
|
| items | 配置选项卡内容,不支持 `icon` `subtitle` | [StepItem](#stepitem) | [] | 4.24.0 |
|
2022-11-08 15:57:28 +08:00
|
|
|
|
|
2022-09-16 15:52:14 +08:00
|
|
|
|
### StepItem
|
2015-06-25 19:32:06 +08:00
|
|
|
|
|
2016-04-06 16:16:36 +08:00
|
|
|
|
步骤条内的每一个步骤。
|
2015-06-25 19:32:06 +08:00
|
|
|
|
|
2022-11-17 17:31:26 +08:00
|
|
|
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
|
|
|
|
| --- | --- | --- | --- | --- |
|
|
|
|
|
| description | 步骤的详情描述,可选 | ReactNode | - | |
|
|
|
|
|
| disabled | 禁用点击 | boolean | false | |
|
|
|
|
|
| icon | 步骤图标的类型,可选 | ReactNode | - | |
|
|
|
|
|
| status | 指定状态。当不配置该属性时,会使用 Steps 的 `current` 来自动指定状态。可选:`wait` `process` `finish` `error` | string | `wait` | |
|
|
|
|
|
| subTitle | 子标题 | ReactNode | - | |
|
|
|
|
|
| title | 标题 | ReactNode | - | |
|