箭头样式步骤条

 子组件

<!-- 进度条 -->
<template>
  <div class="stepsBox u-flex">
    <div class="stepsContent">
      <div :class="['steps-item',
          { 'finished': current > num,
            'process': current === num && num !== totalSteps,
            'last-process': current === totalSteps && num === totalSteps,
            'middle-wait': current < num && num !== totalSteps,
            'last-wait': current < num && num === totalSteps,
          }
        ]" v-for="num in totalSteps" :key="num" @click="onChange(num)">
        <div class="m-steps-icon">
          <span class="u-icon">{
  
  { num }}</span>
        </div>
        <div class="m-steps-content u-flex">
          <div class="u-steps-description">{
  
  { stepsDesc[num-1].name  }}
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "Steps",
  props: {
    stepsDesc: {
      type: Array,  // 步骤描述数组
      default: () => {
        return [];
      },
    },
    totalSteps: {
      type: Number,// 总的步骤数
      default: 3,
    },
    currentStep: {
      type: Number,   // 当前选中的步骤
      default: 1,
    },
  },
  data () {
    return {
      // 若当前选中步骤超过总步骤数,则默认选择步骤1
      current: this.currentStep > this.totalSteps ? 1 : this.currentStep,
    };
  },

  watch: {
    currentStep: {
      handl
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值