Steps 步骤条
代码演示
0
步骤 1
0
步骤 2
0
步骤 3
0
步骤 4
基础用法
步骤条最基础的用法。
查看代码 < />
<template>
<section class="steps-demo">
<w-steps :active="active1" finish-status="success">
<w-step title="步骤 1"></w-step>
<w-step title="步骤 2"></w-step>
<w-step title="步骤 3"></w-step>
<w-step title="步骤 4"></w-step>
</w-steps>
<w-button style="margin-top: 12px;" @click="next">下一步</w-button>
</section>
</template>
<script>
export default {
data () {
return {
active1: 0,
}
},
methods: {
next() {
+ this.active1++
}
},
}
</script>
0
病 历
请为患者填写病历
0
检 验
正在做检验项目
0
检 查
正在做检查项目
0
处 方
正在开具处方
有描述的步骤条
为 description 传入内容, 可以为该步骤添加对应的状态描述,标题和描述居中。
查看代码 < />
<template>
<w-steps :active="1" align-center>
<w-step title="病 历" description="请为患者填写病历"></w-step>
<w-step title="检 验" description="正在做检验项目"></w-step>
<w-step title="检 查" description="正在做检查项目"></w-step>
<w-step title="处 方" description="正在开具处方"></w-step>
</w-steps>
</template>
编 辑
分 享
删 除
有图标的步骤条
通过给 icon 属性传入图标class,可以为步骤条启用各种自定义的图标,有状态引导。
查看代码 < />
<template>
<w-steps :space="200" :active="0" finish-status="success" lead>
<w-step title="步骤 1" icon="w-icon-edit"></w-step>
<w-step title="步骤 2" icon="w-icon-share-link-solid"></w-step>
<w-step title="步骤 3" icon="w-icon-delete-solid"></w-step>
</w-steps>
</template>
0
步骤 1
0
步骤 2
0
步骤 3
0
步骤 4
竖式步骤条
设置 direction='vertical' 即可得到竖式步骤条。
查看代码 < />
<template>
<div style="height: 300px;">
<w-steps direction="vertical"
:active="1">
<w-step title="步骤 1"></w-step>
<w-step title="步骤 2"></w-step>
<w-step title="步骤 3"></w-step>
<w-step title="步骤 4"></w-step>
</w-steps>
</div>
</template>
0
已完成
0
审核失败
0
未进行
0
未进行
步骤错误提示
process-status 参数可以为步骤添加状态, 其默认值为 process。
查看代码 < />
<template>
<section class="steps-demo">
<w-steps :active2="active2" process-status="error">
<w-step title="已完成"></w-step>
<w-step title="审核失败"></w-step>
<w-step title="未进行"></w-step>
<w-step title="未进行"></w-step>
</w-steps>
</section>
</template>
<script>
export default {
data () {
return {
active2: 1,
}
},
methods: {
},
}
</script>
API
Steps Attributes
参数 | 说明 | 类型 | 可选值 | 默认值 | Version |
---|---|---|---|---|---|
active | 设置当前激活步骤 | Number | — | 0 | |
align-center | 进行居中对齐 | Boolean | — | false | |
direction | 显示方向 | String | vertical/horizontal | horizontal | |
finish-status | 设置结束步骤的状态 | String | wait / process / finish / error / success | finish | |
lead | 状态引导 | Boolean | true / false | false | |
process-status | 设置当前步骤的状态 | String | wait / process / finish / error / success | process | |
space | 每个 step 的间距,不填写将自适应间距。支持百分比。 | Number / String | — | — |
Step Attributes
参数 | 说明 | 类型 | 可选值 | 默认值 | Version |
---|---|---|---|---|---|
description | 描述性文字 | String | — | — | |
icon | 图标 (传入 icon 的 class 全名来自定义 icon,也支持 slot 方式写入) | String | — | — | |
status | 设置当前步骤的状态,不设置则根据 steps 确定状态 | String | wait / process / finish / error / success | — | |
title | 标题 | String | — | — |
Step Slot
name | 说明 | Version |
---|---|---|
description | 自定义描述性文字 | |
icon | 自定义图标 | |
title | 自定义标题 |
贡献者
类型 | 参与者 |
---|---|
设计者 | UED视觉组 |
维护者 | UED前端组 |