当前位置:网站首页>el-progress实现进度条颜色不同
el-progress实现进度条颜色不同
2022-08-05 05:24:00 【MoXinXueWEB】
el-progress实现进度条颜色不同
实现效果:
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-c22et1ka-1655793148148)(C:\Users\huawei\AppData\Roaming\Typora\typora-user-images\image-20220620223508990.png)]](/img/df/46a145da4834cf15178e1e39eb2f45.png)
实现代码如下:
<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>
边栏推荐
- NAT实验
- Call the TensorFlow Objection Detection API for object detection and save the detection results locally
- spark source code-RPC communication mechanism
- wc、grep、tar、vi/vim
- spark source code - task submission process - 5-CoarseGrainedExecutorBackend
- 实力卷王LinkSLA,实现运维工程师快乐摸鱼
- From "dual card dual standby" to "dual communication", vivo took the lead in promoting the implementation of the DSDA architecture
- 正则表达式小实例--去掉字符串中间和两边的空格
- 浏览器存储WebStorage
- Tencent Cloud Message Queue CMQ
猜你喜欢

Autoware--Beike Tianhui rfans lidar uses the camera & lidar joint calibration file to verify the fusion effect of point cloud images

LinkSLA insists that users come first and creates a sustainable operation and maintenance service plan
![[Day8] Commands involved in using LVM to expand](/img/ba/39b81cbcecec9bc54a710ff9dba81a.png)
[Day8] Commands involved in using LVM to expand

Hugo搭建个人博客

Getting Started Doc 06 Adding files to a stream

深度 Zabbix 使用指南——来自惨绿少年
![[issue resolved] - jenkins pipeline checkout timeout](/img/3d/c14276d2b5ce18fc3d1288abb059c0.png)
[issue resolved] - jenkins pipeline checkout timeout

Into the pre-service, thought they play so flowers

IP packet format (ICMP protocol and ARP protocol)

单臂路由实验和三层交换机实验
随机推荐
By solving these three problems, the operation and maintenance efficiency will exceed 90% of the hospital
Spark source code - task submission process - 6-sparkContext initialization
js dynamically get screen width and height
Hugo搭建个人博客
Network wiring and digital-to-system conversion
VLAN介绍与实验
静态路由
disabledDate 日期选择器 datePicker
Call the TensorFlow Objection Detection API for object detection and save the detection results locally
spark source code - task submission process - 2-YarnClusterApplication
深度 Zabbix 使用指南——来自惨绿少年
From "dual card dual standby" to "dual communication", vivo took the lead in promoting the implementation of the DSDA architecture
markdown editor template
Why can't I add a new hard disk to scan?How to solve?
Into the pre-service, thought they play so flowers
初识网页与浏览器
The highlight moment of operation and maintenance starts with intelligence
Getting Started 04 When a task depends on another task, it needs to be executed in sequence
Does flink cdc currently support Gauss database sources?
LinkSLA坚持用户第一,打造可持续的运维服务方案