vue简易流程图

在这里插入图片描述

<template>
  <div class="y-process-simple-wrapper">
    <div v-for="(item, index) in processData" :key="index" class="main" style="width: 100%;">
      <i v-if="index === 0" class="el-icon-caret-bottom triangle"></i>
      <div class="content">
        <div :class="`content-title ${item.type === 1 ? 'blue-bg' : 'yellow-bg'}`"><i :class="item.title === '发起人' ? 'el-icon-position' : (item.title === '确认人' ? 'el-icon-s-custom' : 'el-icon-s-check')"></i> {{item.title}}</div>
        <div class="content-text">{{item.context}}</div>
      </div>
      <div class="arrow-wrap">
        <div class="line"></div>
        <i v-if="index !== processData.length - 1" class="el-icon-caret-bottom triangle"></i>
      </div>
    </div>
    <i class="dot"></i>
    <div>流程结束</div>
  </div>
</template>

<script>
export default ({
  props: {
    title: {
      type: String,
      default: ''
    },
    processData: {
      type: Array,
      default: () => {
        return [{
          title: '发起人',
          type: 1,
          context: 'isahdlhwihwskehdxkjhdkhwouiejsjijisjijiwhiahsjhjhsjhjsh'
        }, {
          title: '确认人',
          type: 1,
          context: 'isahdlhwihwskehdxkjhwhiahsjhjhsjhjsh'
        }, {
          title: '复核人',
          type: 2,
          context: 'isahdlhwihwskehdxkjhdkhwouiejsjijisjijiwhiahsjhjhsjhjsh'
        }]
      }
    }
  }
})
</script>

<style lang="stylus">
.y-process-simple-wrapper
  width 100%
  display flex
  flex-direction column
  align-items center
  .main
    width 100%
    display flex
    flex-direction column
    align-items center
    .content
      width 50%
      border-radius 10px
      text-align left
      box-shadow 0 0 10px #ccc
      .content-title
        padding 10px
        color white
        border-radius 10px 10px 0 0
      .content-text
        padding 10px
    .arrow-wrap
      position relative
      .triangle
        position absolute
        bottom -8px
        right -11px
      .line
        width 3px
        height 42px
        background #909399
  .dot
    width 10px
    height 10px
    border-radius 50%
    background-color #909399
  .blue-bg
    background rgb(87, 106, 149)
  .yellow-bg
    background rgb(255, 148, 62)
  .triangle
    font-size 25px
    color #909399
</style>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值