el-table 单元格样式修改


<el-table :cell-style="set_cell_style">
set_cell_style({row, column, rowIndex, columnIndex}){
    // 阻断不为0
    if (column.label === '阻断'){
        let value = 0
        // smell.BLOCKER
        let prop = column.property.split('.')
        if (prop.length === 2){
            value = row[prop[0]][prop[1]]
        }else {
            value = row[prop[0]]
        }
        return value!==0 ? 'color:red' : ''
    } else if (column.label === 'UT通过率'){
        let cell_value = row[column.property]
        if ( cell_value !== '100.0' && cell_value !== 0) {
            return 'color:red'
        }
        return ''
    } else {
        return ''
    }
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM