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

手写一个uniapp的步骤条组件

在template实现

<template><view class="process_more"><!-- 步骤条 --><view class="set-2" :key="index" v-for="(item,index) in options"><!-- 图片 --><view class="img-border"><view class="left_img"></view></view><view v-if='index!=0' class="left_line_up"></view><view v-if='index!=options.length-1' class="left_line_down"></view><view class="set-view"><view class="set-view-test"><view class="set-view-test2">{{item.time}}</view></view><view class="set-view-test3">{{item.text1}}</view></view></view></view>
</template>

js中(样式图大概是,可以随意替换图片等)

// 步骤条options: [{text1: '打卡时间 09:01:01',time: '上班打卡 09:01:01'},{text1: '2022-5-21 2:00:12',time: '下班打卡'},]

CCS里面实现 

<style lang="scss">/* 时间线 */.process_more {background-color: #fff;}.process_text {position: relative;.process_left {position: absolute;top: 170rpx;left: 40rpx;image {width: 44rpx;height: 44rpx;}}}.set-2:last-child::after {display: none;}.set-2 {border-radius: 10rpx;width: 600rpx;margin-left: 100rpx;margin-top: 60rpx;position: relative;.set-view {width: 493rpx;.set-view-test {margin: 0 auto;padding-top: 26rpx;padding-bottom: 30rpx;border-bottom: 1rpx solid #EFEFEF;.set-view-test2 {width: 100%;height: 26rpx;font-family: Gibson;font-size: 32rpx;color: #333333;}}.set-view-test3 {margin: 0 auto;font-size: 26rpx;color: #999;}}}/* 普通 */.set-2 .img-border {width: 18rpx;height: 17rpx;background: gray;border-radius: 50%;position: absolute;top: 50%;margin-top: -1rpx;left: -58rpx;z-index: 100;}/* 特殊 */.set-2:nth-of-type(1)>.img-border {width: 38rpx;height: 38rpx;background: #4B74F1;border-radius: 50%;position: absolute;top: 50%;margin-top: -3rpx;left: -68rpx;z-index: 100;}.set-2:nth-of-type(1) .left_img {border-radius: 50%;width: 16rpx;height: 16rpx;background: #4B74F1;top: 50%;margin-top: 13rpx;margin-left: 10rpx;}.left_line_up {position: absolute;top: 0;left: -52upx;height: 50%;margin-top: -22rpx;border-style: solid;border-left: 1rpx;border-color: #ccc;}.left_line_down {position: absolute;top: 50%;left: -52upx;height: 60%;margin-top: 22rpx;border-style: solid;border-left: 1rpx;border-color: #ccc;}
</style>

相关文章:

  • OSPF高级特性2(特殊区域,聚合)
  • 【Linux基础IO篇】系统文件接口(1)
  • 大厂面试题-TCP协议为什么要设计三次握手?
  • Python selenium驱动下载,模块安装以及基本使用
  • fastadmin笔记,关联查询,下拉框,关联下拉框查询,编辑时下拉框默认值
  • ArcGIS制作土地利用现状图
  • 第5天:基础入门-资产架构amp;端口amp;应用amp;CDNamp;WAFamp;站库分离amp;负载均衡
  • Fabric二进制建链(客户端与节点主机分离)
  • 【MATLAB源码-第65期】基于matlab的OFDM/OTFS通信系统性能对比,输处误码率曲线;对比是否采用LDPC编码。
  • 自动驾驶算法(三):RRT算法讲解与代码实现(基于采样的路径规划)
  • 资源限流 + 本地分布式多重锁——高并发性能挡板,隔绝无效流量请求
  • 【DriveGPT学习笔记】自动驾驶汽车Autonomous Vehicle Planning
  • 决胜ACM算法竞赛:掌握Python编程的基石
  • 【Azure】存储服务:Azure 的存储账户
  • Git 标签(Tag)实战:打标签和删除标签的步骤指南
  • 【108天】Java——《Head First Java》笔记(第1-4章)
  • Angularjs之国际化
  • js学习笔记
  • SpiderData 2019年2月16日 DApp数据排行榜
  • STAR法则
  • 从PHP迁移至Golang - 基础篇
  • 从重复到重用
  • 对超线程几个不同角度的解释
  • 给初学者:JavaScript 中数组操作注意点
  • 算法之不定期更新(一)(2018-04-12)
  • CMake 入门1/5:基于阿里云 ECS搭建体验环境
  • FaaS 的简单实践
  • (04)Hive的相关概念——order by 、sort by、distribute by 、cluster by
  • (LeetCode C++)盛最多水的容器
  • (附源码)ssm智慧社区管理系统 毕业设计 101635
  • (转)编辑寄语:因为爱心,所以美丽
  • .bat批处理(十一):替换字符串中包含百分号%的子串
  • .describe() python_Python-Win32com-Excel
  • .NET Core WebAPI中封装Swagger配置
  • .Net 路由处理厉害了
  • .NET/C# 检测电脑上安装的 .NET Framework 的版本
  • .Net转前端开发-启航篇,如何定制博客园主题
  • @synthesize和@dynamic分别有什么作用?
  • @zabbix数据库历史与趋势数据占用优化(mysql存储查询)
  • [ 环境搭建篇 ] 安装 java 环境并配置环境变量(附 JDK1.8 安装包)
  • [ActionScript][AS3]小小笔记
  • [acwing周赛复盘] 第 94 场周赛20230311
  • [BZOJ] 1001: [BeiJing2006]狼抓兔子
  • [C#]扩展方法
  • [C++]priority_queue的介绍及模拟实现
  • [CSS]CSS 字体属性
  • [go] 迭代器模式
  • [HDU]2161Primes
  • [LeetCode][LCR190]加密运算——全加器的实现
  • [linux] git lfs install 安装lfs
  • [Oh My C++ Diary]#ifndef / #define / #endif 使用详解
  • [one_demo_11]二分查找法
  • [POJ - 2386]
  • [python] 过年燃放烟花
  • [Spark][Hive]Hive的命令行客户端启动: