[英]How to show progress bar in different colors for the rows using prime ng progress bar in angular2
當我查看p-progressBar組件的代碼時,似乎可以傳遞styleClass
屬性綁定將自定義類綁定到p-progressBar
<td>
<p-progressBar width="100" [value]="statusDisplay.progressValue"
[styleClass]="getStyleClass(statusDisplay)">
</p-progressBar>
</td>
// you can have your own logic for class.
getStyleClass (statusDisplay) {
return statusDisplay.progressValue > 50 ? 'progressBar-green': ''
}
要么
其他方法將使用style
屬性,如文檔中所示
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.