el-table ---row-class-name ----cell-class-name

row-class-name

<el-table stripe v-if="!isHidden" :data="rankDta" height="22.2rem" width="100%"
          :row-class-name="getRowClass"  v-loading="loading" element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading" element-loading-background="rgba(143, 188, 143, 0.8)">
  
getRowClass(rowIndex) {
  if (rowIndex.rowIndex === 0) {
    return 'red'
  } else {
    return ''
  }
}
 
  


cell-class-name

changeColcolor({ row, column, rowIndex, columnIndex }) {
  if (columnIndex === this.btindex) {
    return 'red'
  }
}

你可能感兴趣的:(el-table ---row-class-name ----cell-class-name)