Skip to content

Steps 步骤条

多步骤流程引导组件。支持水平/垂直两种方向,四种状态(wait/process/finish/error),圆点样式,可点击切换。

基础用法

vue
<template>
  <see-steps v-model="current" :steps="steps" />
</template>

<script setup>
import { ref } from 'vue'
const current = ref(1)
const steps = [
  { title: '步骤一', description: '描述一' },
  { title: '步骤二', description: '描述二' },
  { title: '步骤三', description: '描述三' }
]
</script>

垂直方向

vue
<template>
  <see-steps v-model="current" :steps="steps" direction="vertical" />
</template>

圆点样式

vue
<template>
  <see-steps v-model="current" :steps="steps" :is-dot-style="true" />
</template>

StepItem

属性类型说明
titlestring步骤标题
descriptionstring步骤描述
iconstring步骤图标
status'wait' | 'process' | 'finish' | 'error'步骤状态

自由跳转

默认 isClickable=true 时只允许回退到已完成的步骤;如果希望允许任意步骤之间自由跳转,开启 isFreeJump

vue
<template>
  <see-steps
    v-model="current"
    :steps="steps"
    :is-clickable="true"
    :is-free-jump="true"
  />
</template>

Props

属性类型默认值说明
modelValuenumber0当前步骤索引(越界值会自动 clamp 到 [0, steps.length - 1]
stepsStepItem[][]步骤列表
direction'horizontal' | 'vertical''horizontal'方向
activeColorstring''激活时颜色
inactiveColorstring''未激活时颜色
isDotStylebooleanfalse是否使用圆点样式
isClickablebooleanfalse是否可点击切换
isFreeJumpbooleanfalse是否允许自由跳转。默认 false 时只能回退到已完成步骤,true 时可任意跳转

Events

事件名参数说明
update:modelValuevaluev-model 同步(点击切换时触发)
onChangeindex, step步骤切换
onFinish-完成所有步骤(切换到最后一步时触发)

辽 ICP 备 2025070134 号