需要实现如下效果图:
实现的需求是,取数组对象里面,amount最大的值作为100%,其余按照这个标准进行计算得到显示的进度条百分比
<template> <div class="app-container"> <div class="chart-container"> <el-row :gutter="14"> <el-col :span="12"> <div v-loading="chartLoading" class="chart-wrapper" style="margin-bottom: 14px;" > <h3>近半年重量企业排名</h3> <div v-if="status3 === 'data'" class="rank_div" > <div v-for="(item, index) in leaseSortData" :key="index" class="rank_box" > <div class="li_fl" :style="{background: index == 0 ? '#fff1f1' : index == 1 ? '#fff5ee' : index == 2 ? '#fff8e6' : '#f4f4f4', color: index == 0 ? '#ff9292' : index == 1 ? '#ff9950' : index == 2 ? '#f7b500' : '#8b8b8b' }" > <div>{ { index+1 }}</div>