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

uniapp 微信小程序 vue3.0+TS手写自定义封装步骤条(setup)

uniapp手写自定义步骤条(setup)

话不多说 先上效果图:
在这里插入图片描述
setup.vue组件代码:

<template><view class="stepBox"><viewclass="stepitem"v-for="(item, index) in stepList":key="index":style="stepList.length > index + 1 ? 'width:200rpx' : 'width:60rpx'"><img :src="item.activeimg" class="img" v-if="activestep >= index + 1" /><img :src="item.img" class="img" v-else /><view:class="activestep >= index + 1 ? 'circle activecircle' : 'circle'"></view><view:class="activestep > index + 1 ? 'line activeline' : 'line'"v-if="stepList.length > index + 1"></view><view :class="index + 1 == 3 ? 'text1' : 'text'">{{ item.title }}</view></view></view>
</template>
<script setup lang="ts">
import { ref, reactive, watch } from "vue";
const props = withDefaults(defineProps<{ activestep: Number }>(), {activestep: 0,
});
const stepList = ref<any>([{img: "../static/image/setups/a1.png",activeimg: "../static/image/setups/a.png",title: "未开始",},{img: "../static/image/setups/b1.png",activeimg: "../static/image/setups/b.png",title: "核查中",},{img: "../static/image/setups/c1.png",activeimg: "../static/image/setups/c.png",title: "结果审核中",},{img: "../static/image/setups/d1.png",activeimg: "../static/image/setups/d.png",title: "已完成",},
]);
</script>
<style lang="scss" scoped>
.stepBox {width: 100%;margin: 0 auto;display: flex;justify-content: center;align-items: center;background: #fff;.stepitem {height: 150rpx;position: relative;.img {position: absolute;top: 0px;left: -18rpx;width: 56rpx;height: 56rpx;}.circle {position: absolute;top: 60rpx;width: 18rpx;height: 18rpx;border-radius: 50%;background: #e7eaea;}.activecircle {background: #59c28a;}.line {position: absolute;top: 68rpx;left: 18rpx;border-bottom: 4rpx solid #e7eaea;width: calc(100% - 18rpx);z-index: 10;}.activeline {border-bottom: 4rpx solid #00cd73;}.text {position: absolute;top: 85rpx;left: -34rpx;font-size: 28rpx;color: #0e102b;}.text1 {position: absolute;top: 85rpx;left: -62rpx;font-size: 28rpx;color: #0e102b;}}
}
</style>

以下是用到的图片
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

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

相关文章:

  • Python 金融大数据分析
  • 初识C++入门(1)
  • 使用Selenium的WebDriver进行长截图
  • python+大数据校园卡数据分析 计算机竞赛
  • 【机器学习】sklearn降维算法PCA
  • 华为云云耀云服务器L实例评测|企业项目最佳实践之评测用例(五)
  • Xcode升级到15.0 解决DT_TOOLCHAIN_DIR问题
  • 小谈设计模式(29)—访问者模式
  • 【25】c++设计模式——>责任链模式
  • GlobalTransactional
  • Android Studio运行kotlin项目,一直Read timed out
  • Excel 的单元格内容和单元格格式
  • 4大软件测试策略的特点和区别(单元测试、集成测试、确认测试和系统测试)
  • armbian 安装mysql
  • Ubuntu22常用软件
  • 【CFD小工坊】浅水模型的边界条件
  • 电力物联网关智能通讯管理机-安科瑞黄安南
  • 用Flask构建一个AI翻译服务
  • 微信小程序引入阿里巴巴iconfont图标并使用
  • mysql面试题49:MySQL中不同text数据类型的最大长度
  • 从虚拟电厂在上海的实践探索看企业微电网数字化的意义
  • 创建并初始化线程池
  • 【LeetCode热题100】--136.只出现一次的数字
  • Java idea查看自定义注解的调用地方
  • ReLU激活函数
  • 【Android】adjustViewBounds 的理解和使用
  • Redis知识补充
  • IIS 部署.NetCore,最细步骤
  • 4.查询用户的累计消费金额及VIP等级
  • 解决MySQL错误-this is incompatible with sql_mode=only_full_group_by