当前位置: 首页 > news >正文

uniapp中使用封装步骤条组件

 针对步骤条封装完终于清清楚楚啦

先看效果:

附上代码:使用可直接复用:数据是写在了当前组件中,如有必须,可以使用其中的props传值stepInfos传递相应的数据,根据steps步数就可以控制走到哪一步啦

<template><view class="step-bar"><view class="step_item" v-for="(item,index) in stepInfo.list" :key="item.id"><view :class="stepInfo.step >= index+1 ? 'circle circle-active':'circle'"></view><view :class="stepInfo.step >= index+2 ? 'line line-active':'line'" v-if="index!==stepInfo.list.length-1"></view><view class="middle-box"><text:class="stepInfo.step < index+1 ? 'text1-actived':stepInfo.step == index+1?'text1-active':text1">{{item.name}}</text><text class="text2">{{item.time}}</text></view><view class="status_text":class="stepInfo.step < index+1 ? 'text1-actived':stepInfo.step == index+1?'text1-active':text1">{{item.status}}</view></view></view>
</template><script>export default {props: {// 传递步骤参数stepInfo: {type: Object,default: function() {return {list: [],step: 0}}}},data() {return {stepInfo: {step: 3,list: [{id: 1,name: '发起充值',time: '2020-12-12 12:47:56',status: '已完成'}, {id: 2,name: '处理中',time: '2020-12-12 12:47:56',status: '进行中'}, {id: 3,name: '到账成功',time: '2020-12-12 12:47:56',status: '未开始'}]}}},}
</script><style lang="scss" scoped>.step_item {position: relative;height: 144rpx;display: flex;.line {position: absolute;top: 40rpx;left: 8rpx;content: "";width: 4rpx;height: 100rpx;background-color: #E6E8EF;}.line-active {background-color: #FF2B46;}}.circle {width: 20rpx;height: 20rpx;margin-right: 40rpx;margin-top: 10rpx;border-radius: 50%;background-color: #E6E8EF;}.circle-active {background-color: #FF2B46;}.middle-box {display: flex;flex-direction: column;.text2 {color: #999999;font-size: 24rpx;}}.text1 {color: #666666;font-size: 28rpx;}.text1-active {color: #FF2B46;}.text1-actived {color: #333333;}.status_text {flex-grow: 1;display: flex;justify-content: flex-end;font-size: 28rpx;}.status_text_active {// color: #FF2B46;}
</style>

http://www.lryc.cn/news/265500.html

相关文章:

  • 【MySQL】sum 函数和 count 函数的相同作用
  • 在QT Creator下用CMake编译GEOS库
  • 【Qt之Quick模块】4. QML语法格式及命名规范
  • Python内置类属性__class__属性的使用教程
  • 【后台报错】插入时sql报错,varchar撑爆
  • OpenSergo使用详解
  • Vanilla Pro for Mac 一款隐藏菜单栏图标工具
  • freemarkEngine文件ftl的可视化编辑
  • 2023 英特尔On技术创新大会直播 | 边云协同加速 AI 解决方案商业化落地
  • Q-star计划的更多细节
  • python3 数据分析项目案例,用python做数据分析案例
  • Android 12 (InputMethodManagerService) 替换默认输入法为Pinyin输入法
  • 【模式识别】探秘判别奥秘:Fisher线性判别算法的解密与实战
  • 【XML】TinyXML 详解
  • 泛社交裂变场景下AB增量科学评估方案
  • 【无标题】json报错
  • MyBatis中延迟加载,全局和局部的开启使用与关闭
  • MyBatis增删改查基础及其xml文件
  • 视觉学习(1)—— 理论
  • pip 常用指令 pip list 命令用法介绍
  • 【DP】62.不同路径
  • 大数据、知识图谱和强化学习的综合应用
  • MFC使用高速绘图控件high-speed Charting Control绘制柱形图
  • vue3 H5项目中实现PDF预览
  • 【WebRTC---源码篇】(十一:一)采集编码发送期间使用时间戳的详细解读
  • Python学习路线 - Python语言基础入门 - Python异常、模块与包
  • eventbus,在this.$on监听事件时无法在获取数据
  • 【Python必做100题】之第二十五题(统计字符)
  • 开发语言:ArkTS
  • Qt中字符串转换为JS的函数执行