当前位置:网站首页>el-progress实现进度条颜色不同
el-progress实现进度条颜色不同
2022-08-05 05:24:00 【MoXinXueWEB】
el-progress实现进度条颜色不同
实现效果:
实现代码如下:
<template>
<div>
<h1>进度条排名</h1>
<div style="width: 400px; height: 40px; margin: 0 auto; display: flex; align-item: center; justify-content: flex-start" v-for="(item, index) in egList" :key="index">
<div style="width: 15%; line-height: 40px; text-algin: center; padding-left:10px">{
{ index+1 }}</div>
<div style="width: 65%; text-algin: left; font-size: 8px;">
<!-- 名称 -->
<div style="height: 20px;">{
{item.name}}</div>
<el-progress :percentage="item.num/1000*100" :show-text="false" :stroke-width="8" :color="getColor(index)"></el-progress>
</div>
<div style="width: 20%; line-height: 40px; padding-right: 10px; min-width: 40px">{
{Number(item.num).toFixed(2)}}</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
egList: [
{
num: 889,
name: '小龙虾'
},
{
num: 785,
name: '车厘子'
},
{
num: 686,
name: '榴莲'
},
{
num: 535,
name: '海参'
},
{
num: 423,
name: '鲍鱼'
},
{
num: 400,
name: '炒鱿鱼'
},
{
num: 388,
name: '小洋房'
},
{
num: 376,
name: '庄园'
}
]
}
},
mounted() {},
methods: {
// 针对排名前三的颜色特殊处理
getColor(val) {
switch(val) {
case 0:
return '#ad2410';
// break;
case 1:
return '#e67845';
// break;
case 2:
return '#3d6aff';
// break;
default:
'#2f53c9';
break;
}
}
}
}
</script>
default:
'#2f53c9';
break;
}
}
}
}
</script>
边栏推荐
- CIPU, what impact does it have on the cloud computing industry?
- Spark source code-task submission process-6.2-sparkContext initialization-TaskScheduler task scheduler
- 磁盘管理与文件系统
- Disk management and file systems
- markdown editor template
- Browser Storage WebStorage
- 智能运维会取代人工运维吗?
- 错误类型:反射。ReflectionException:无法设置属性“xxx”的“类”xxx”与价值“xxx”
- Proprietary host CDH
- Getting Started 04 When a task depends on another task, it needs to be executed in sequence
猜你喜欢
VRRP概述及实验
[issue resolved] - jenkins pipeline checkout timeout
The problem of redirecting to the home page when visiting a new page in dsf5.0
单臂路由实验和三层交换机实验
技术分享杂七杂八技术
教您简单几步实现工业树莓派正确安装RS232转USB驱动
实力卷王LinkSLA,实现运维工程师快乐摸鱼
从“双卡双待“到”双通“,vivo率先推动DSDA架构落地
Problems encountered in installing Yolo3 target detection module in Autoware
IP packet format (ICMP protocol and ARP protocol)
随机推荐
Hard Disk Partitioning and Permanent Mounting
Insight into the general trend of the Internet, after reading this article, you will have a thorough understanding of Chinese domain names
Tencent Cloud Message Queue CMQ
IP地址及子网的划分
spark operator-parallelize operator
解决这三大问题,运维效率将超90%的医院
markdown editor template
NAT实验
Does flink cdc currently support Gauss database sources?
传输层协议(TCP3次握手)
spark source code - task submission process - 1-sparkSubmit
ACLs and NATs
错误类型:反射。ReflectionException:无法设置属性“xxx”的“类”xxx”与价值“xxx”
NIO works is analysed
VRRP概述及实验
Servlet跳转到JSP页面,转发和重定向
The idea of commonly used shortcut key
spark source code-RPC communication mechanism
LinkSLA insists that users come first and creates a sustainable operation and maintenance service plan
Unity realizes first-person roaming (nanny-level tutorial)