vue 进度条 组件

<template>
  <div class="step-face">
    <div v-for="(item, index) in stepArray" class="step" :class="index+1>value?'will-step':index+1==value?'doing-step':index+1<value?'complete-step':''" :key="index">
        <span class="icon-step" v-if="value<=index+1">{{index+1}}</span>
         <span class="icon-step" v-else></span>
        <span class="step-text" >{{item}}</span>
        <span class="step-line"></span> 
    </div>
  </div>
</template>

<script>
export default {
  props: {
    //步骤数字
    value: {
      default: 0,
      type: Number,
      required: true,
    },
    //步骤数组
    stepArray: {
      type: Array,
      required: true,
    }
  }
}
</script>


<style scoped lang="scss">

  .step-face{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .step-face .icon-step{
    display: inline-block;
    width: 32px;
    height: 32px;
    margin-right: 8px;
    text-align: center;
    line-height: 32px;
    font-size: 16px;
  }
  .step{
    display: flex;
    align-items: center;
  }
  .step-face .step:not(:last-child) .step-line{
    display: inline-block;
    width: 190px;
    height: 1px;
    background: rgba(0,0,0,.15);
    margin-left: 10px;
    flex: 1;
  }
  .step .step-text{
    font-size: 16px;
    font-family: PingFangSC-Regular,PingFang SC;
    font-weight: 400;
    color: rgba(0,0,0,.65);
  }
  .step-face .step:not(:last-child){
    margin-right: 17px; 
    flex: 1;
  }
  .step-face .will-step .icon-step{
    border: 1px solid rgba(0,0,0,.15);
    color: rgba(0,0,0,.15);
    border-radius: 50%;
  }
  .step-face .doing-step .icon-step{
    background: #4c68ef;
    border-radius: 50%;
    color: #fff;
    border-color: #4c68ef;
  }
  .step-face .doing-step .step-text{
    font-weight: bold;
    color: #333;
  }
  .step-face .complete-step .icon-step{
    background: url('../../../assets/schooladmin/icondon.png') no-repeat;
    background-size: 100%;
  }
</style>
 <step :stepArray="steparr" :value="status"></step>

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值