vue手写步骤条功能

效果图:
在这里插入图片描述
可能代码质量也不太好

html代码:

	<div class="step">
      <div>
        <div class="posit">
          <div :class="'radius' + ' ' +(step>=1 ? 'speed-bg-color':'')">
            <van-icon name="records" :color="step>=1?'#fff':''"/>
          </div>
          <div class="line line1"></div>
        </div>
        <div class="text">
          <h1 :class="'fonts'+' '+ (step>=1 ? 'speed-text-color':'')">在线报名</h1>
          <p class="s-font ccc-color">报名时间:</p>
        </div>
      </div>
      <div>
        <div class="posit">
          <div :class="'radius' + ' ' +(step>=2 ? 'speed-bg-color':'')">
            <van-icon name="calendar-o" :color="step>=2?'#fff':''" />
          </div>
          <div class="line"></div>
        </div>
        <div class="text">
          <h1 :class="'fonts'+' '+ (step>=2 ? 'speed-text-color':'')">考试安排</h1>
          <p class="s-font ccc-color">考试时间:</p>
          <p class="s-font ccc-color">考试地点:</p>
        </div>
      </div>
      <div>
        <div class="posit">
          <div :class="'radius' + ' ' +(step>=3 ? 'speed-bg-color':'')">
            <van-icon name="phone-circle-o" :color="step>=3?'#fff':''"  />
          </div>
          <div class="line"></div>
        </div>
        <div class="text">
          <h1  :class="'fonts'+' '+ (step>=3 ? 'speed-text-color':'')">参加考试</h1>
        </div>
      </div>
      <div>
        <div class="posit">
          <div :class="'radius' + ' ' +(step>=4 ? 'speed-bg-color':'')">
            <van-icon name="idcard" :color="step>=4?'#fff':''"  />
          </div>
          <div class="line"></div>
        </div>
        <div class="text">
          <h1 :class="'fonts'+' '+ (step>=4 ? 'speed-text-color':'')">核发证书</h1>
        </div>
      </div>
    </div>

css代码:

 h1{
   color: #999;
 }
 .info {
   height: 1rem;
   width: 100%;
   display: flex;
   align-items: center;
   margin-bottom: 0.2rem;
   box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.349019607843137);
 }
 .info > div {
   flex: 1;
   display: flex;
   padding-left: 0.3rem;
   /* justify-content: ; */
   align-items: center;
 }
 .step {
   width: 100%;
   /* height: 3rem; */
   padding-left: 2rem;
   box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.349019607843137);
 }
 .step > div {
   height: 2rem;
   /* background-color: skyblue; */
   margin-bottom: 0.1rem;
   position: relative;
 }
 .posit{
   position: absolute;
   left: -1.5rem;
   top: 0.5rem;
 }
 .radius{
   width: 1rem;
   height: 1rem;
   border-radius: 50%;
   /* background-color: #999; */
   border: 1px solid #999;
   display: flex;
   justify-content: center;
   align-items: center;
 }
 .van-icon{
   font-size: 0.8rem;
   color: #999;
 }
 .line{
   height: 1.1rem;
   width: 1px;
   background: #999;
   position: absolute;
   left: 0.5rem;
   top: -1.1rem;
 }
 .line1{
   height: 0;
   width: 0;
 }
 .text{
   height: 100%;
   display: flex;
   flex-direction: column;
   justify-content: center;
 }
 .speed-bg-color{
   border: none !important;
   background-color: #00f !important;
   
 }
 .speed-text-color{
   color: #00f !important;
 }
 .speed-icon-color{
   color: #fff !important;
 }

js代码:

export default {
  data(){
    return{
      step: 3,
    }
  }
}
</script>
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值