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