当前位置:网站首页>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>
边栏推荐
- Tensorflow prompts typeerror: unsupported operand type (s) for *: 'float' and 'nonetype‘
- vant3+ts DropdownMenu 下拉菜单,数据多能滚动加载
- First acquaintance with go language
- Second week of electric control learning
- Flink 维表异步查询的实现以及问题排查
- 极限编程--根源分析实践
- Memory control of node
- EasyCode模板
- Office application cannot start normally 0xc0000142
- bug记录:更新数据库时报错:Data truncation: Incorrect datetime value:
猜你喜欢

Cesium抛物线方程

1723. minimum time to complete all work

Byte flybook Human Resources Kit three sides

Saturated! Can't future programmers work anymore?

进阶之大山-asp.net core 路由程序基础使用演示0.1
![Vulnhub[DC3]](/img/3a/1aa03e804d447d38e85807928fdb8f.png)
Vulnhub[DC3]

Volcano engine held a video cloud technology force summit and released a new experience oriented video cloud product matrix

淘宝Native研发模式的演进与思考 | DX研发模式

office应用程序无法正常启动0xc0000142

vant3 +ts 封装简易step进步器组件
随机推荐
SQL游标(cursor)详细说明及内部循环使用示例
Kali2022安装armitage
SSM integrates FreeMarker and common syntax
TensorFlow从网络读取数据
徽商期货开户可靠吗?资金安全吗?
Lightweight and convenient small program to app technology solution to realize interconnection with wechat / traffic app
论文《Deep Interest Evolution Network for Click-Through Rate Prediction》
Alibaba cloud image station supports IPv6!
1.5 什么是架构师(连载)
消息队列存储消息数据的 MySQL 表格
Enterprise internal online training system source code
Tcp/ip family structure and protocol of tcp/ip series overview
电控学习 第二周
一物一码追踪溯源系统介绍
SSM集成FreeMarker以及常用语法
ssm常用到的依赖
Use GCC's PGO (profile guided optimization) to optimize the entire system
错误记录:IllegalStateException: Optional int parameter ‘xxxx‘ is
Flink 维表异步查询的实现以及问题排查
JDBC几个坑