首页 > 其他分享 >vue 步骤条

vue 步骤条

时间:2023-08-11 22:55:12浏览次数:48  
标签:vue name color 步骤 relative position border display

效果图

<template>
   <!--  -->
   <div class='stepBar' v-if="list">
      <dl>
         <dd v-for="(item, index) in list" :key="index" :class="{ actafter: index + 1 <= selected }" class="al">
            <div class="round" :class="{ act: index + 1 <= selected }">{{ index + 1 }}</div>
            <div class="text" :class="{ acttext: index + 1 <= selected }" >
               <div class="borderText" >
                  <span class="textpe" v-if="item.type == 1"> {{ item.name }}</span>
                  <span class="texttype" v-if="item.type == 2"> {{ item.name }}</span>
              </div>
              <div class="tip" v-if="item.type == 2">
                  <span  v-for="(items,i) in item.chan" :key="i">{{ items.name }}</span>
               </div>
            </div>
         </dd>
      </dl>
   </div>
</template>
<script>
export default {
   name: 'stepBar',
   props: {
      list: {
         typeof: Array,
         default: () =>
            [
               {
                  type: 2, name: '步骤基本1', chan: [
                     { name: '双方基本信息' },
                     { name: '双方基本信息2' },
                  ]
               },
               { type: 1, name: '步骤基本2' },
               { type: 1, name: '步骤基本3' },
               { type: 1, name: '步骤基本4' }
            ]
      },
      selected: {
         typeof: Number, String,
         default: 2
      },
   },
   components: {},
   data() {
      return {
      };
   },
   computed: {
      // 主体设置
   },
   watch: {},
   methods: {
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
   },
   beforeCreate() { }, //生命周期 - 创建之前
   beforeMount() { }, //生命周期 - 挂载之前
   beforeUpdate() { }, //生命周期 - 更新之前
   updated() { }, //生命周期 - 更新之后
   beforeDestroy() { }, //生命周期 - 销毁之前
   destroyed() { }, //生命周期 - 销毁完成
   activated() { }, //如果页面有keep-alive缓存功能,这个函数会触发
}
</script>
<style  scoped lang="less">
dl,
dd {
   margin: 0;
   padding: 0;
}

.stepBar {
   position: relative;

   dl {
      display: flex;
      position: relative;

      dd {
         position: relative;
         width: 100%;
         height: 100%;
         display: flex;
         flex-direction: column;
         align-items: center;

         .round {
            position: relative;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background-color: #b0bfd2;
            text-align: center;
            display: flex;
            justify-content: center;
            align-items: center;
            color: #fff;
            font-size: 12px;
            z-index: 1;
            box-shadow: 0px 12px 16px rgba(0, 0, 0, 0.3);
         }

         .text {
            margin: 8px 0px;
            font-size: 14px;
            position: relative;
         }
         .borderText{
            display: flex;
            justify-content: center;
         }
         .texttype {
            position: relative;
            margin: 5px 0px;
         }
         .textpe {
            position: relative;
            margin: 27px 0px;
         }

         .texttype::before {
            content: "";
            display: inline-block;
            width: 20%;
            height: 100%;
            border-top: 1px dashed #bcd5f2;
            border-left: 1px dashed #bcd5f2;
            position: absolute;
            left: -32%;
            top: 50%;
         }

         .texttype::after {
            content: "";
            display: inline-block;
            width: 20%;
            height: 100%;
            border-top: 1px dashed #bcd5f2;
            border-right: 1px dashed #bcd5f2;
            position: absolute;
            right: -32%;
            top: 50%;

         }
         
         .tip{
            position: relative;
            span{
               position: relative;
               display: inline-block;
               margin: 0px 10px;
               font-size: 12px;
            }
            span:first-child::after {
               content: '';
               position: absolute;
               border-style: solid;
               border-color: transparent;
               border-width: 3px 0 3px 5px;
               border-left-color: #2971c9;
               right: -13px;
               top: 5px;
            }
         }
      }

      .al::after {
         position: absolute;
         content: '';
         top: 8px;
         left: 0;
         width: 100%;
         height: 5px;
         background-color: #bcd5f2;
      }

      .al:first-child::after {
         left: 50%;
      }

      .al:last-child::after {
         width: 50%;
      }

      .actafter::after {
         background-color: #2971c9 !important;
      }

      .act {
         background-color: #2971c9 !important;
         box-shadow: 0px 12px 16px rgba(41, 113, 201, 0.3) !important;
      }

      .acttext {
         color: #2971c9 !important;
      }

   }
}</style>

 

标签:vue,name,color,步骤,relative,position,border,display
From: https://www.cnblogs.com/zxh-bug/p/17624092.html

相关文章

  • Vue全家桶系~2.Vue3开篇(过渡)
    Vue全家桶先贴一下Vue3的官方文档:https://cn.vuejs.org/guide/introduction.html官方API文档:https://cn.vuejs.org/api/1.前言:新旧时代交替1.1.开发变化1.网络模型的变化:以前网页大多是b/s,服务端代码混合在页面里;现在是c/s,前后端分离,通过jsapi(类似ajax的方式)获取j......
  • 插件系列 vue2安装tailwindcss
    官方网址:https://www.tailwindcss.cn/docs/installation安装步骤:直接安装创建文件tailwindcss.cssmain.js全局引入文件tailwindcss.css在项目更目录下执行初始化配置文件指令第一步:直接安装npminstall-Dtailwindcss@npm:@tailwindcss/postcss7-compatpostcs......
  • 文本关键词高亮-vue版本
    、、<template><div><div><inputtype="text"@keyup.enter="mark"></div><divref="text"style="height:200px;overflow:auto"v-html="html"></div>......
  • Jtti:如何删除服务器端口地址的详细步骤和实施方法
    服务器端口是网络通信中的关键要素,它们定义了服务器上特定服务的入口点。然而,有时我们需要删除不再需要或不再使用的端口地址以提高网络安全性和性能。通过本文中提供的指南和解释,读者将能够了解如何准确地删除服务器端口地址,包括常见的删除方法、重要的注意事项以及相关的实施技巧......
  • vue2使用table进行单元格合并,后面列合并需根据前某列条件合并
    示例:<tableclass="table_style"><thead><tr><td>姓名</td><td>年龄</td><td>车辆</td>&......
  • 2022最新上传ipa到appstore的步骤说明​
    我们平时在开发原生的iosapp的时候,有苹果电脑在手,上传ipa文件到苹果开发者中心比较简单,直接在xcode上就可以实现了。但是现在大多数人开发app不再是用原生框架开发了,也没有苹果电脑。很多朋友们选择了跨平台的H5技术来开发app,真正做到实现一种语法到处运行的场景。现在比较热的框......
  • Vue 内置指令
       示例:<template><span><divid="app"v-cloak>{{msg}}<br>{{obj.name}}<br>{{f1()}}<br>{{num>10?'大于10':'小于10'}}<br><spanv-text=&quo......
  • Vue进阶(幺肆捌):Vuex 辅助函数详解
    (文章目录)一、前言一般情况下,如果需要访问vuex.store中state存放的数据,需要使用this.$store.state.属性名方式。显然,采取这样的数据访问方式,代码略显繁杂,辅助函数为了解决繁杂行问题应运而生。二、辅助函数通过辅助函数mapGetters、mapState、mapActions、mapMutations,把vuex.......
  • RTSP/Onvif视频服务器LntonNVR(源码版)视频监控平台修改录像文件的存储位置的具体操作步
    LntonNVR是基于RTSP/Onvif协议接入的视频平台,具备视频直播监控、录像、检索与回看、存储、国标级联等视频能力,可支持将接入的视频流进行全平台、全终端的分发,包括RTSP、RTMP、HTTP-FLV、WS-FLV、HLS、WebRTC等。在应用上,LntonNVR可以用在智慧工厂、智慧工地、智慧园区、智慧港口等......
  • vue 实现动态表单点击新增 增加一行输入框
    点击增加后会新增一行,点击每行后面的删除图标则会删除该行,新增按钮只会出现在最后一行<el-col:span="12"class="mb20"> <el-form-item :label="index==0?'选择原材料':''" v-for="(item,index)inform.productItemList"......