Element UI 环型进度条自定义样式百分比

Element UI 环型进度条自定义样式百分比

如下图

在这里插入图片描述

1.自定义环型样式

  • :stroke-width=“16”:定义环形粗细
  • circleCenter,circleBox:环形内百分比样式
  • el-progress-circle__track:改变环形图底色
  • el-progress内的color:环形图占比颜色
<div class="circleBox">
          <el-progress color="#6bbf69" type="circle" :show-text="false" :stroke-width="16" :percentage="typeof dashboardData.mem_usage !== 'undefined' && dashboardData.mem_usage !== null ? dashboardData.mem_usage : 0"></el-progress>
          <div class="circleCenter">
            <div style=" font-weight: bold; font-size: 18px;"> {{dashboardData.mem_usage}}%</div>
            <div style="  font-size: 10px;">使用率 </div>
          </div>
          <div> <span style=" ">内存:</span> <span style=" color: #32798b;  font-weight: bold;">{{dashboardData.mem_total}}</span>GB</div>
</div>

2. css代码

 .circleBox {
  position: relative;
  text-align: center;
  width: 200px;
}

 .circleCenter {
  position: absolute;
  top: 45px;
  left: 70px;

}
.el-progress-circle__track {
  stroke: #b7e5c1;
}

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值