条形百分比3
<div class="content"> <div> <div class="chart-rising-list" v-for="(item, index) in proportionList.slice(0, 5)" :key="item + index" > <div class="chart-rising-title"> <div> <img :src="item.imgBg" alt="" /> <span>{{ item.name }}</span> </div> <div> <span class="num-text">(350条)</span> <span class="num-bf"> 35% </span> </div> </div> <div class="chart-rising-external"> <div :style="{ width: item.num + '%', background: item.bg }" class="chart-rising-inside" ></div> </div> </div> </div> <div> <div class="chart-rising-list" v-for="(item, index) in proportionList.slice(5, 10)" :key="item + index" > <div class="chart-rising-title"> <div> <img :src="item.imgBg" alt="" /> <span>{{ item.name }}</span> </div> <div> <span class="num-text">(350条)</span> <span class="num-bf"> 35% </span> </div> </div> <div class="chart-rising-external"> <div :style="{ width: item.num + '%', background: item.bg }" class="chart-rising-inside" ></div> </div> </div> </div> </div>
.content { display: flex; flex-wrap: wrap; .chart-rising-list { width: 130px; margin-bottom: 14px; margin-left: 17px; .chart-rising-title { display: flex; font-size: 10px; font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; color: #f7f7f7; line-height: 14px; justify-content: space-between; margin-bottom: 4px; div { display: flex; span { margin-left: 3px; } img { width: 14px; height: 14px; overflow: hidden; } .num-text { font-size: 8px; font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; color: #f7f7f7; } .num-bf { font-size: 10px; font-family: DIN-BoldItalic, DIN; font-weight: normal; color: #45daf2; line-height: 12px; background: linear-gradient(180deg, #ffffff 0%, #49b3ff 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } } } .chart-rising-external { display: flex; align-items: center; width: 100%; height: 3px; background: rgba(9, 111, 255, 0.3); border-radius: 22px; .chart-rising-inside { height: 3px; border-radius: 22px; background: linear-gradient(270deg, #0e79c1 0%, #064dba 100%); } } } }
proportionList: [ { name: "抖音", num: 85, bg: "linear-gradient(270deg, #0E79C1 0%, #064DBA 100%)", id: 1, imgBg: require("@/assets/icons/icon-ph-1.png"), }, { name: "电视", num: 72, bg: "linear-gradient(270deg, #AEFEDD 0%, #00FEE7 100%)", id: 2, imgBg: require("@/assets/icons/icon-ph-2.png"), }, { name: "抖音", num: 30, bg: "linear-gradient(270deg, #A4A6F8 0%, #6B6DEE 100%)", id: 3, imgBg: require("@/assets/icons/icon-ph-3.png"), }, { name: "抖音", num: 50, bg: "linear-gradient(270deg, #F8F6A4 0%, #EEDD6B 100%)", id: 4, imgBg: require("@/assets/icons/icon-ph-4.png"), }, { name: "抖音", num: 50, bg: "linear-gradient(270deg, #F8F6A4 0%, #EEDD6B 100%)", id: 5, imgBg: require("@/assets/icons/icon-ph-5.png"), }, { name: "抖音", num: 85, bg: "linear-gradient(270deg, #0E79C1 0%, #064DBA 100%)", id: 6, imgBg: require("@/assets/icons/icon-ph-6.png"), }, { name: "电视", num: 72, bg: "linear-gradient(270deg, #AEFEDD 0%, #00FEE7 100%)", id: 7, imgBg: require("@/assets/icons/icon-ph-7.png"), }, { name: "抖音", num: 30, bg: "linear-gradient(270deg, #A4A6F8 0%, #6B6DEE 100%)", id: 8, imgBg: require("@/assets/icons/icon-ph-8.png"), }, { name: "抖音", num: 50, bg: "linear-gradient(270deg, #F8F6A4 0%, #EEDD6B 100%)", id: 9, imgBg: require("@/assets/icons/icon-ph-9.png"), }, { name: "抖音", num: 50, bg: "linear-gradient(270deg, #F8F6A4 0%, #EEDD6B 100%)", id: 10, imgBg: require("@/assets/icons/icon-ph-10.png"), }, ],