<el-progress type="circle" v-if="energyData.thisDateVsLastDateRate" :show-text="false" status="exception"
:width="100"
:percentage="parseFloat(energyData.thisDateVsLastDateRate)"
:stroke-width="6"></el-progress>
原因:因为数据还没有会来但是DOM已经渲染了(注意:percentage的值类型是number值)
<el-progress type="circle" v-if="energyData.thisDateVsLastDateRate" :show-text="false" status="exception"
:width="100"
:percentage="parseFloat(energyData.thisDateVsLastDateRate) >100? 100 : parseFloat(energyData.thisDateVsLastDateRate)"
:stroke-width="6"></el-progress>
关键是这两句
v-if="energyData.thisDateVsLastDateRate"
:percentage="parseFloat(energyData.thisDateVsLastDateRate) >100? 100 : parseFloat(energyData.thisDateVsLastDateRate)"