欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 养生 > 原生步骤条书写

原生步骤条书写

2025/2/24 6:19:34 来源:https://blog.csdn.net/qq_51463650/article/details/142880520  浏览:    关键词:原生步骤条书写

步骤条预览

第一步:
在这里插入图片描述
第二步:
在这里插入图片描述
第三步:
在这里插入图片描述

代码展示

html

  <div class="contract"><div class="step-box"><div class="step-part" v-for="(step,index) in stepArray" :key="index"><div class="step-txt"><span :class="active >= step.id ? 'step-id-active' : 'step-id'" ><!--    van-icon 是框架vant,如果你的项目未使用vant框架,可以换成一个本地的小图标  判断条件不要忘记 v-if="active > step.id"     --><van-icon v-if="active > step.id" name="checked" color="#1989fa" size="20" style="background: #FFFFFF;"/><span v-else>{{step.id + 1}}</span></span><span :class="active > step.id ? 'step-line-active' : 'step-line'" v-show="step.id !== 2"></span></div><span class="step-name">{{step.name}}</span><span class="step-detail">{{step.detail}}</span></div></div><br><br><br><button @click="active = 0 ">0</button><button @click="active = 1 ">1</button><button @click="active = 2 ">2</button></div>

js
基于vue

import {reactive, ref} from "vue";const active = ref(0);
const stepArray = reactive([{id:0,name:'合同信息',detail:'填写合同信息',},{id:1,name:'合同模板',detail:'填写合同信息',},{id:2,name:'合同发起',detail:'预览和发起',}
])

css


.contract{width: 100%;height: 100%;overflow: auto;.step-box{width: 100%;height: 120px;background: #FFFFFF;display: flex;justify-content: center;text-align: center;.step-part{width: 30%;text-align: center;.step-txt{padding-top: 10px;display: flex;position: relative;.step-id-active{display: block;background: #409EFF;width: 20px;height: 20px;line-height: 20px;text-align: center;border-radius: 50px;color: #FFFFFF;font-size: 12px;margin-left: calc(50% - 10px);}.step-id{display: block;background: #DCDEE0;width: 20px;height: 20px;line-height: 20px;text-align: center;border-radius: 50px;color: #FFFFFF;font-size: 12px;margin-left: calc(50% - 10px);}.step-line-active{width: calc(100% - 20px);height: 3px;background: #409EFF;display: block;position: absolute;top: 18px;left: calc(50% + 11px);}.step-line{width: calc(100% - 20px);height: 3px;background: #DCDEE0;display: block;position: absolute;top: 18px;left: calc(50% + 11px);}}.step-name{display: block;color: #323233;}.step-detail{display: block;font-size: 12px;color: #969799;}}}
}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词