<template scope="scope" :style="{'color': customColor}">
<el-progress
:percentage="scope.row.rate"
type="line"
:color="customColorMethod"
:show-text="false"
class="progress">
</el-progress>
<span class="progress-text" >{{ scope.row.rate }}%</span>
</template>
没有使用elementUI原生的百分比数字,因为不知道怎么改,就自己加了个span
:style绑在span上的话,会全部更改,想要的是随着进度不同,会变成不同的颜色,与进度条同色,要如何实现
用计算属性存颜色计算结果,既能复用逻辑又能缓存避免多次计算。