element table(任意td改变背景颜色cell-class-name)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_39237755/article/details/81252346
<el-table class='mt10' type="selection" :data="tableData" border ref="dataTable" :cell-class-name="rowClass">

 

rowClass ({ row, column, rowIndex, columnIndex }) {
  if (rowIndex === 5 && columnIndex === 4) {
    return 'rgb196'
  } else if (rowIndex === 6 && columnIndex === 4) {
    return 'bacColorf4984e'
  } else if (rowIndex === 6 && columnIndex === 5) {
    return 'bacColor317eb0'
  }
}

 

.rgb196{
  background: rgb(196,196,196);
}
.bacColor317eb0{
  background: #317eb0;
}
.bacColorf4984e{
  background: #f4984e;
}

阅读更多
换一批

没有更多推荐了,返回首页