当前位置:网站首页>Vant3 +ts packaged simple step advancer component
Vant3 +ts packaged simple step advancer component
2022-06-12 17:48:00 【Enthusiastic learning】

Companies need this step Progress bar ,vant The component provides a bit difficult to change , So I found one on the Internet , Some changes were made

step Components Change when using stepActive Value
<template>
<div style="background-color: white">
<div class="steps">
<div class="step" v-for="(i, index) in stepList" :key="index">
<div class="step-head" :class="
activeValue == i.stepIndex || i.stepIndex <= activeValue
? 'step-finish'
: 'step-wait'
">
<div class="step-line" :class="
activeValue == i.stepIndex + 1 || i.stepIndex + 1 <= activeValue
? 'step-finish'
: 'step-wait'
">
<i class="step-line-inner"></i>
</div>
<div v-if="activeValue==i.stepIndex" class="step-img">
<img src="@/assets/img/set_on.png" alt="">
</div>
<div v-else-if="i.stepIndex + 1 <= activeValue" class="step-img">
<img src="@/assets/img/step_su.png" alt="">
</div>
<div class="step-icon" v-else :class="{ active: activeValue + 1 === i.stepIndex }">
<div class="step-icon-text">{
{ i.stepIndex }}</div>
</div>
</div>
<div class="step-main" :class="
activeValue == i.stepIndex || i.stepIndex <= activeValue
? 'step-finish'
: 'step-wait'
">
<div class="step-title" :class="{ active: activeValue + 1 === i.stepIndex }">
{
{ i.title }}
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import { defineComponent, reactive, ref, toRefs } from 'vue'
interface Props {
activeValue: number // File address - Two way binding
}
const props = withDefaults(defineProps<Props>(), {
activeValue: 1,
})
// const activeValue = ref(2);
const stepList = ref();
// Step number
stepList.value = [
{
stepIndex: 1,
title: " To be processed ",
},
{
stepIndex: 2,
title: " In processing ",
},
{
stepIndex: 3,
title: " Completed ",
},
];
</script>
<style lang="scss" scoped>
.steps {
display: flex;
text-align: center;
.step {
flex-basis: 33%;
margin-right: 0px;
.step-head {
position: relative;
width: 100%;
.step-line {
left: 67%;
right: -36%;
height: 0.1px;
top: 31px;
position: absolute;
border: 1px solid;
border-color: inherit;
// background-color: #c0c4cc;
.step-line-inner {
transition-delay: 0ms;
// border-width: 1px;
width: 100%;
display: block;
// border: 1px solid;
// border-color: inherit;
transition: 0.15s ease-out;
box-sizing: border-box;
width: 0;
height: 0;
}
}
.step-icon {
position: relative;
z-index: 1;
display: inline-flex;
justify-content: center;
align-items: center;
width: 20px;
height: 20px;
font-size: 12px;
box-sizing: border-box;
background: #c8c9cc;
// transition: 0.15s ease-out;
border-radius: 50%;
// border: 2px solid;
// border-color: inherit;
&.active {
color: #333 !important;
}
.step-icon-text {
display: inline-block;
user-select: none;
text-align: center;
font-weight: 700;
line-height: 1;
color: #fff;
}
}
.step-img{
// display: flex;
// align-items: center;
// margin-right: 36px;
img{
// display: inline-block;
width: 20px;
height: 20px;
vertical-align:bottom
}
}
}
.step-main {
.step-title {
font-size: 14px;
line-height: 38px;
// font-weight: 700;
text-align: center;
color: #6E6E6E;
&.active {
color: #3C3C3C !important;
}
}
}
}
.step:last-of-type .step-line {
display: none;
}
// Current location style
.step-finish {
color: #EE0A24;
}
.step-wait {
color: #dcdee0;
}
}
</style>
边栏推荐
- grpc-swift入门
- 轻量、便捷的小程序转App技术方案,实现与微信/流量App互联互通
- vant3 +ts 封装简易step进步器组件
- Kali2022 installing Armitage
- Soringboot下RestTemplateConfig 配置打印请求响应日志
- DRM 驱动 mmap 详解:(一)预备知识
- Evolution and thinking of Taobao native R & D mode | DX R & D mode
- Exclusive interview with oppo find X5 Product Manager: deeply cultivate self-developed chips to create the ultimate flagship experience with the highest standards
- 论文《Deep Interest Evolution Network for Click-Through Rate Prediction》
- Saturated! Can't future programmers work anymore?
猜你喜欢
![Vulnhub[DC3]](/img/3a/1aa03e804d447d38e85807928fdb8f.png)
Vulnhub[DC3]

Use GCC's PGO (profile guided optimization) to optimize the entire system

Deep interest evolution network for click through rate prediction
Goframe gredis configuration management | comparison of configuration files and configuration methods

Arm64棧回溯

php 实现无限极分类树(递归及其优化)

Schedule update | 2022 Microsoft and Intel hacker song competition is in hot registration

Yyds dry goods inventory leetcode question set 911 - 920

Arm64 stack backtracking

论文《Deep Interest Evolution Network for Click-Through Rate Prediction》
随机推荐
32-bit MCU mm32f0040 with smart micro high performance M0 kernel
《用户体验要素:以用户为中心的产品设计》笔记
迄今微软不同时期发布的SQL Server各版本之间的大致区别,供参考查阅
1723. minimum time to complete all work
Getting started with grpc swift
数组按指定顺序排序
Figma from getting started to giving up
分辨率与行场同步信号的关系 场消隐
Graphical data model for system design
C# 业务流水号规则生成组件
消息队列实战之队列优先级
Authorization in Golang ProjectUseing Casbin
php 实现无限极分类树(递归及其优化)
Deep interest evolution network for click through rate prediction
MySQL学习笔记
vant3+ts DropdownMenu 下拉菜单,数据多能滚动加载
Arm64 stack backtracking
New media operation material website sharing enables you to create current affairs with half the effort
Recognize function originality
73. 矩阵置零(标记法)