跳转到内容

步骤条 Steps

Steps

步骤条布局

一般可用于描述或显示相关业务进度的场景, 比如外卖下单 -> 商家接单 -> 骑手接单 -> 骑手配送 -> 完成

使用方式:Steps 一般与枚举类型搭配使用(后端需要一个枚举类型来配合)

Steps API

参数说明类型默认值
current指定当前步骤,可配置成 step 中对应的 key,可被子 Step 元素 status 属性覆盖。number0
labelPlacement指定标签放置位置,可选值:vertical | horizontalstringhorizontal
progressDot点状步骤条,可以设置为一个 function,labelPlacement 将强制为verticalboolean | (iconDot, {index, status, title, description}) => ReactNodefalse
size指定大小,可选值:default | smallstringdefault
status指定当前步骤的状态,可选值:wait | process | finish | errorstringprocess
initial起始序号,从 0 开始记数number0
align图标和内容对齐方式,目前仅对水平方向的步骤条有效center | left0

Steps.Step API

参数说明类型默认值
key唯一标识,使用 show 后计算会不准确,此时 current 可配对应 key 值string-
title标题string | ReactNode-
description步骤的详情描述,可选string | ReactNode-
icon步骤图标的类型,可选string | ReactNode-
status指定状态。当不配置该属性时,会使用 Steps 的 current 来自动指定状态。可选值:wait | process | finish | errorstringwait
onClick点击事件() => void-
show是否展示boolean-

示例图

Steps 示例代码

18

<View title="人员列表">
<Steps current="1">
<Step
title="外卖下单"
description="这是外卖下单"
key="1"
/>
<Step
title="商家接单"
description="这是商家接单"
key="2"
/>
<Step
title="骑手接单"
description="这是骑手接单"
key="3"
/>
<Step
title="骑手配送"
description="这是骑手配送"
key="4"
/>
<Step
title="完成"
description="这是完成"
key="5"
/>
</Steps>
</View>

18

<View title="人员列表">
<Steps current="one">
<Step
title="Finished"
description="This is a description."
@onClick="() => console.log('click')"
key="zero"
:show="getContainerByKey('table').data[0].name === '12'"
/>
<Step
title="In Progress"
description="This is a description."
key="one"
:show="getContainerByKey('table').data[0].name === '1212'"
/>
<Step
title="Waiting"
description="This is a description."
key="two"
/>
</Steps>
</View>