我要给“黄色”颜色直到50%,在50%之后它会显示“绿色”。
它不像笔触颜色功能。我想看到黄色或绿色。不在一起。
是否有可能处理(最好是不使用CSS)?
import { Progress } from 'antd';
<Progress
percent={this.state.progress}
/>
使用strokeColor
道具:
<Progress
percent={this.state.progress}
strokeColor={this.state.progress < 50 ? "yellow" : "green"}
/>
在此处检查:https : //codesandbox.io/s/dynamic-ant-design-demo-icli2
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句