vue某单元格设置背景色

 

<el-table
:data="testCases"
stripe
border
:cell-style="addClass"
ref="table">
-----------------------------------

addClass({row,column,rowIndex,columnIndex}){
      if(columnIndex === 5){
        if(row.xxx == 'Yes'){
           return 'background:#bfdac4';
        }
        if(row.xxx== 'No'){
          return 'background:#f1b6a7';
        }
      }
    }

 

posted @ 2020-07-16 10:44  君子笑而不语  阅读(2859)  评论(0编辑  收藏  举报