[Vuejs]-How do I change a cell in the element-ui table?

0👍

you can use this method.


<el-table 
   :data="tableData" 
  :cell-style="cellStyle"
>
</el-table>

js

const cellStyle = ({ row, column, rowIndex, columnIndex }) => {
  if (rowIndex === 1 && columnIndex === 1) {
    return {
      backgroundColor: 'pink'
    }
  }
}

enter image description here

Leave a comment