流程进度条案例

流程进度条


前言

最近在公司里面看到了流程进度条的需求,然后在网上找了许多案例发现使用起来有些复杂,所以就根据公司的需求自己写了一个小案例,主要是使用vue+css实现,下面是我的代码,可以直接放在组件中引入使用,数据我是直接写死在data中这样更直观


# 二、代码 代码和图片示例如下(示例):

在这里插入图片描述

下面展示代码。

// An highlighted block
<template>
<div class="box">
   <div class="container"
    v-for="(item,index) in option"
    :key="index"
   >
      <span class="big_circle"
      :style="{border:  item.state === 'true' ? '2px solid rgb(128, 174, 243)' : '2px solid rgb(197, 195, 195)'}"
      ></span>
     <span class="circle"
      :style="{background:  item.state === 'true' ? ' rgb(128, 174, 243)' : ' rgb(197, 195, 195)'}"
     ></span>
     <span class="border"
     :style="{background:  item.state === 'true' ? 'rgb(107, 162, 233)' : ' rgb(211, 218, 228)'}"
     ></span>
     <h4 class="title">{{item.name}}</h4>
     <h5 class="date"
     :style="{display: item.state === 'true' ? 'block' : 'none'}"
     >{{item.date}}</h5>
   </div>
</div>
</template>
  
<script>
export default{
   data() {
     return{
       option: [{name: '审批开始', date: '2012-12-10',state: 'true'},
       {name: '审批中', date: '2012-12-11',state: 'false',},
       {name: '审批成功', date: '2012-12-12',state: 'false'}]
     }
   }
 }
</script>

<style lang="less" scoped>
.box {
  width: 600px;
  height: 200px;
  position: relative;
  top: 100px;
  left: 100px;
  .container {
    width:200px;;
    height: 200px;
    float: left;
    position: relative;
    .big_circle{
       display: inline-block;
        position: absolute;
        top: 50px;
        left: 0px;
        height: 20px;
        width: 20px;
        border-radius: 50%;
        box-sizing: border-box;
        border: 2px solid rgb(128, 174, 243);
        background: rgb(248, 249, 250);
        z-index: 998;
    }
      .circle{
        display: inline-block;
        position: absolute;
        top: 54px;
        left: 4px;
        height: 12px;
        width: 12px;
        border-radius: 50%;
        box-sizing: border-box;
       background: rgb(107, 162, 243);
        z-index: 999;
      }
      .border{
        position: absolute;
        top: 55px;
        left: 1px;
        display: inline-block;
        width: 100%;
        height: 10px;
        background: rgb(211, 218, 228);
        z-index: 1;
      }
      .title {
         position: absolute;
         top: 100px;
        left: 0;
      }
      .date{
        position: absolute;
        left: 0px;
        top: 125px;
      }
  }
  .container:last-child .border{
    display: none;
  }
}
</style>

总结

第一次写文章,有问题希望大佬指点指正

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值