当前位置:网站首页>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>
边栏推荐
- The spark operator - repartition operator
- VLAN details and experiments
- [Day8] Commands involved in using LVM to expand
- spark operator-wholeTextFiles operator
- I/O性能与可靠性
- Wechat applet page jump to pass parameters
- King power volume LinkSLA, realize operations engineer is happy fishing
- Configuration of TensorFlow ObjecDetectionAPI under Anaconda3 of win10 system
- Mina断线重连
- 【Day8】RAID Disk Array
猜你喜欢
有哪些事情是你做了运维才知道的?
markdown编辑器模板
[Day8] Commands involved in using LVM to expand
[Problem has been resolved]-Virtual machine error contains a file system with errors check forced
Dsf5.0 bounced points determine not return a value
Transport layer protocol (TCP 3-way handshake)
Getting Started 04 When a task depends on another task, it needs to be executed in sequence
[Day1] VMware software installation
网络层协议介绍
Configuration of TensorFlow ObjecDetectionAPI under Anaconda3 of win10 system
随机推荐
In-depth Zabbix user guide - from the green boy
[issue resolved] - jenkins pipeline checkout timeout
[问题已处理]-jenkins流水线checkout超时
RAID磁盘阵列
LinkSLA坚持用户第一,打造可持续的运维服务方案
Wireshark packet capture and common filtering methods
[Day5] Soft and hard links File storage, deletion, directory management commands
有哪些事情是你做了运维才知道的?
Technology Sharing Miscellaneous Technologies
This is indeed the best article on microservice architecture I have read!
spark operator-parallelize operator
【Day8】RAID Disk Array
技术分享杂七杂八技术
wc、grep、tar、vi/vim
ALC实验
Transport layer protocol (TCP 3-way handshake)
Quick question and quick answer - FAQ of Tencent Cloud Server
Spark source code-task submission process-6.1-sparkContext initialization-create spark driver side execution environment SparkEnv
监控系统的内卷,有什么讲究?
从“双卡双待“到”双通“,vivo率先推动DSDA架构落地