纯css 竖向步骤条

一、平常做一些物流啊提现啊这些效果的时候可能就需要用到步骤来向用户展示具体到哪一步了,但是呢有时候写的又比较繁琐,找各种组件插件又要安装或者引入对应的包,今天就给大家分享一个纯css的竖向步骤条,先看效果图:

二、废话不多说,直接上代码,HTML:

<div class="stepItem" v-for="(item,index) in billList.handle" :key="index">
    <van-icon name="passed" size=".45rem" color="#07c160" ></van-icon>
	<div class="stepBox">
		<span>{{item.name}}</span>
		<span>{{item.time}}</span>
	</div>
</div>

 三、CSS

.stepItem{
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: relative;
	padding-bottom: 0.5rem;
}
.stepItem:not(:last-of-type):after{
	content: "";
	font-size: 0;
	height: 65%;
	width: 0.05rem;
	background: #07c160;
	position: absolute;
	left: 0.2rem;
	top: 0.48rem;
}
.stepBox{
	width: 90%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.34375rem;
	color: #07c160;
}

四、如果复制粘贴出现排版错乱问题,请把rem换成px,在伪类里面微调left和top的值,以上就是本次的分享,希望大家物喜勿喷,谢谢!有用了vantUI库的图标。

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
UniApp 是一个基于 Vue.js 的跨平台框架,可以用于开发多个平台的应用程序。如果你想要自定义竖向步骤,可以通过使用 Vue.jsCSS 来实现。 首先,你可以创建一个组件来表示每个步骤,例如 Step.vue: ```vue <template> <div :class="{'step': true, 'active': isActive}">{{ index }}</div> </template> <script> export default { props: { index: { type: Number, required: true }, isActive: { type: Boolean, default: false } } } </script> <style scoped> .step { width: 50px; height: 50px; border-radius: 50%; line-height: 50px; text-align: center; background-color: #ccc; } .active { background-color: #ff0000; color: #fff; } </style> ``` 然后,在你的页面中使用这个组件来创建竖向步骤,例如 Steps.vue: ```vue <template> <div class="steps"> <step v-for="(step, index) in steps" :key="index" :index="index + 1" :is-active="currentStep === index + 1" /> </div> </template> <script> import Step from '@/components/Step.vue' export default { components: { Step }, data() { return { steps: ['Step 1', 'Step 2', 'Step 3'], currentStep: 1 } } } </script> <style scoped> .steps { display: flex; flex-direction: column; } </style> ``` 在上面的例子中,使用了一个数组来定义步骤的文本内容,然后通过 v-for 指令和 Step 组件来渲染每个步骤。通过给 Step 组件传递 `:is-active` 属性来判断当前步骤是否为激活状态。 这样,你就可以在 UniApp 中自定义竖向步骤了。根据你的需要,你可以根据具体的样式要求进行调整和扩展。希望对你有所帮助!如果你对这方面还有其他问题,可以继续问我。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值