vue中如何用v-f把上述代码简写。

本文介绍了在 Vue.js 框架中如何使用 v-for 指令进行代码简化,通过示例展示了如何将长形式的 v-for 语句转化为更简洁的形式,提高代码可读性和维护性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<div class="public-ctn-bg" style="margin-top: 10px;">
  <!-- <highcharts class="chart" :options="chartOptions2"></highcharts> -->
  <ul class="chart-list">
    <li>
      <div>
        <span>杭州市</span>
        <i>12个</i>
        <i>22%</i>
        <el-progress
          type="circle"
          :percentage="22"
          width="20"
          stroke-width="3"
          :show-text="false"
        ></el-progress>
      </div>
      <div>
        <span>宁波市</span>
        <i>12个</i>
        <i>14%</i>
        <el-progress
          type="circle"
          :percentage="14"
          width="20"
          stroke-width="3"
          :show-text="false"
        ></el-progress>
      </div>
    </li>
    <li>
      <div>
        <span>嘉兴市</span>
        <i>12个</i>
        <i>17%</i>
        <el-progress
          type="circle"
          :percentage="17"
          width="20"
          stroke-width="3"
          :show-text="false"
        ></el-progress>
      </div>
      <div>
        <span>台州市</span>
        <i>12个</i>
        <i>10%</i>
        <el-progress
          type="circle"
          :percentage="10"
          width="20"
          stroke-width="3"
          :show-text="false"
        ></el-progress>
      </div>
    </li>
    <li>
      <div>
        <span>舟山市</span>
        <i>12个</i>
        <i>3%</i>
        <el-progress
          type="circle"
          :percentage="3"
          width="20"
          stroke-width="3"
          :show-text="false"
        ></el-progress>
      </div>
      <div>
        <span>绍兴市</span>
        <i>12个</i>
        <i>15%</i>
        <el-progress
          type="circle"
          :percentage="15"
          width="20"
          stroke-width="3"
          :show-text="false"
        ></el-progress>
      </div>
    </li>
    <li>
      <div>
        <span>湖州市</span>
        <i>12个</i>
        <i>9%</i>
        <el-progress
          type="circle"
          :percentage="9"
          width="20"
          stroke-width="3"
          :show-text="false"
          :color="colors"
        ></el-progress>
      </div>
      <div>
        <span>温州市</span>
        <i>12个</i>
        <i>10%</i>
        <el-progress
          type="circle"
          :percentage="10"
          width="20"
          stroke-width="3"
          :show-text="false"
        ></el-progress>
      </div>
    </li>
  </ul>
</div>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值