鍍金池/ 問(wèn)答/HTML/ el-progress-circle能設(shè)置百分比圓圈的顏色嗎?

el-progress-circle能設(shè)置百分比圓圈的顏色嗎?

想把下面的圓圈中的藍(lán)色換成綠色,有辦法設(shè)置么?

          <div class="circle" align="center">
            <el-progress type="circle" :percentage="pool.ram_percentage" :width="circleWidth" :stroke-width="strokeWidth"></el-progress>
            <p>內(nèi)存 ({{pool.ram_count | bytesToSize}}/{{pool.ram_total | bytesToSize}})</p>
          </div>

圖片描述

回答
編輯回答
硬扛

雖然不知道這個(gè)el-progress-circle是啥,但SVG中可以通過(guò)stroke="#0f0"來(lái)設(shè)置邊框顏色,試試:stroke="'#0f0'"。


element-ui中的progress支持的顏色看起來(lái)是固定的,并且是通過(guò)status屬性來(lái)設(shè)置的。
如:綠色 success,紅色 exception
但修改完status之后,中間的進(jìn)度會(huì)展示為x。
clipboard.png


hack方法

<el-progress class="test" type="circle" :percentage="0"></el-progress>

.test svg > path:first-of-type{
  stroke: red !important;
}

2018年7月26日 12:51
編輯回答
陪她鬧

這個(gè)是用svg做的,你在樣式表里加上這個(gè):

.circle svg {stroke: blue;  // 你想要的顏色}
2018年1月30日 15:42