uniapp-vue3自定义步骤条steps

      <view class="steps-wrap">
        <view class="flex-box" v-for="(item, index) in list" :key="item.id">
          <view :class="['number', isActive(item) ? 'active-number' : '']">{{ index + 1 }}</view>
          <view :class="['desc', isActive(item) ? 'active-desc' : '']">{{ item.title }}</view>
          <view v-if="index < list.length - 1"
                :class="['line', isActive(list[index + 1]) ? 'line3' : 'line1']"></view>
        </view>
      </view>
 import { ref , computed } from "vue";
 const list = ref([
  {id:1 ,title: '提交申请'},
  {id:2 ,title: '审核中'},
  {id:3 ,title: '审核通过'},
  {id:4 ,title: '退款中'},
  {id:5 ,title: '退款成功'},
 ])
 const active = ref(2)
 const isActive = computed(() => {
  return (item) => item.id <= active.value;
});
 .steps-wrap {
  padding: 36rpx 0 0;
  display: flex;
  align-items: center;
  .flex-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
  }
  .number {
    position: relative;
    z-index: 5;
    width: 40rpx;
    height: 40rpx;
    background: #e5e5e5;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24rpx;
  }
  .active-number {
    background: #3283EC;
  }
  .desc {
    font-size: 24rpx;
    color: #c8c8c8;
    line-height: 34rpx;
    margin-top: 20rpx;
    font-weight: 500;
    text-align: center;
  }
  .active-desc {
    color: #484848;
  }
  .line {
    position: absolute;
    top: 18rpx;
    left: 50%;
    z-index: 1;
    width: 100%;
    height: 4rpx;
  }
  .line1 {
    // background: linear-gradient(90deg, #3a9aff 0%, #9cccff 21%, #9cccff);
    background: #e9e9e9;
  }
  .line2 {
    background: #9cccff;
  }
  .line3 {
    background:#3283EC;
  }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值