根据elementui表格中的值确定显示颜色

 

 1.在tabel标签中绑定 :cell-style="cellStyle"    
 2.在methods中定义cellStyle方法
        cellStyle(row, column, rowIndex, columnIndex) {
            if (row.column.label == "事件告警信息" || row.column.label == "性能告警信息"  ) {
                return "color:#FF747B";
            }
            if(row.column.label == "系统状态" && row.row.equStatus == "正常" ){
                 return "color:#08AD2B";
            }
            if(row.column.label == "均衡状态" && row.row.equStatus == "正常" ){
                 return "color:#08AD2B";
            }
        },

 

posted @ 2019-09-09 14:04  grg  阅读(2218)  评论(0编辑  收藏  举报