Steps 步骤条


用于引导用户按照流程完成任务的导航条。

基础用法

简单的步骤条

Steps步骤条 - 图1

  1. <at-steps :current='current'>
  2. <at-step title="Step1" description="This is a description."></at-step>
  3. <at-step title="Step2" description="This is a description."></at-step>
  4. <at-step title="Step3"></at-step>
  5. </at-steps>
  6. <at-button type="primary" @click="prev" style="margin-top: 12px;">Prev</at-button>
  7. <at-button type="primary" @click="next" style="margin-top: 12px;">Next</at-button>

迷你版

迷你版的步骤条

Steps步骤条 - 图2

  1. <at-steps size="small" :current='current'>
  2. <at-step title="Step1" description="This is a description."></at-step>
  3. <at-step title="Step2" description="This is a description."></at-step>
  4. <at-step title="Step3"></at-step>
  5. </at-steps>
  6. <at-button type="primary" @click="prev" style="margin-top: 12px;">Prev</at-button>
  7. <at-button type="primary" @click="next" style="margin-top: 12px;">Next</at-button>

带图标的步骤条

通过设置 Stepicon 属性,可自定义图标。

Steps步骤条 - 图3

  1. <at-steps :current='current'>
  2. <at-step title="Step1" description="This is a description." icon="icon-user"></at-step>
  3. <at-step title="Step2" description="This is a description." icon="icon-airplay"></at-step>
  4. <at-step title="Step3" icon="icon-pocket"></at-step>
  5. </at-steps>
  6. <at-button type="primary" @click="prev" style="margin-top: 12px;">Prev</at-button>
  7. <at-button type="primary" @click="next" style="margin-top: 12px;">Next</at-button>

步骤切换

配合内容及按钮使用,表示一个流程的处理进度。

Steps步骤条 - 图4

  1. <at-steps :current='current'>
  2. <at-step v-for="(step, index) in steps"
  3. :title="step.title"
  4. :key="index"></at-step>
  5. </at-steps>
  6. <div class="steps-content" style="margin-top: 16px; border: 1px solid #e9e9e9; border-radius: 6px;background-color: #fafafa; min-height: 200px; text-align: center; padding-top:80px;">
  7. {{ steps[current].content }}
  8. </div>
  9. <at-button type="primary" @click="prev" style="margin-top: 12px;">Prev</at-button>
  10. <at-button type="primary" @click="next" style="margin-top: 12px;">Next</at-button>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. current: 0,
  16. steps: [{
  17. title: 'First',
  18. content: 'First-content'
  19. }, {
  20. title: 'Second',
  21. content: 'Second-content'
  22. }, {
  23. title: 'Last',
  24. content: 'Last-content'
  25. }]
  26. }
  27. },
  28. methods: {
  29. prev () {
  30. if (this.current-- <= 0)
  31. this.current = 0
  32. },
  33. next () {
  34. if (this.current++ >= 2)
  35. this.current = 2
  36. }
  37. }
  38. }
  39. </script>

竖直方向的步骤条

简单的竖直方向的步骤条

Steps步骤条 - 图5

  1. <at-steps :current='current' direction="vertical">
  2. <at-step title="Step1" description="This is a description."></at-step>
  3. <at-step title="Step2" description="This is a description."></at-step>
  4. <at-step title="Step3" description="This is a description."></at-step>
  5. </at-steps>
  6. <at-button type="primary" @click="prev" style="margin-top: 12px;">Prev</at-button>
  7. <at-button type="primary" @click="next" style="margin-top: 12px;">Next</at-button>

竖直方向的小型步骤条

简单的竖直方向的小型步骤条。

Steps步骤条 - 图6

  1. <at-steps :current='current' size="small" direction="vertical">
  2. <at-step title="Step1" description="This is a description."></at-step>
  3. <at-step title="Step2" description="This is a description."></at-step>
  4. <at-step title="Step3" description="This is a description."></at-step>
  5. </at-steps>
  6. <at-button type="primary" @click="prev" style="margin-top: 12px;">Prev</at-button>
  7. <at-button type="primary" @click="next" style="margin-top: 12px;">Next</at-button>

步骤运行错误

使用 Stepsstatus 属性来指定当前步骤的状态。

Steps步骤条 - 图7

  1. <at-steps :current='current' status="error">
  2. <at-step title="Step1" description="This is a description."></at-step>
  3. <at-step title="Step2" description="This is a description."></at-step>
  4. <at-step title="Step3"></at-step>
  5. </at-steps>
  6. <at-button type="primary" @click="prev" style="margin-top: 12px;">Prev</at-button>
  7. <at-button type="primary" @click="next" style="margin-top: 12px;">Next</at-button>

Steps 参数

参数说明类型可选值默认值
current指定当前步骤,从 0 开始计数Number-0
status指定当前步骤的状态,会覆盖子元素 Step 的状态Stringwait process finish errorprocess
size指定样式大小Stringdefault smalldefault
direction指定步骤条方向Stringhorizontal verticalhorizontal

Steps.Step 参数

参数说明类型可选值默认值
title标题String--
description描述String--
icon图标String--
status指定当前步骤的状态。当不配置此属性时,会使用 Stepscurrent 来自动指定状态Stringwait process finish error-