参数顺序是row, column, cell, event这里的column,其实是cell,得到的是该行的html元素打印row[column.property]才有值 至于获取行列的索引,可以这样 <!--html--> <el-table :cell-class-name="tableCellClassName" @cell-click="cellClick"> ... </el-table> //js methods:{ tableCellClassName({row, column, rowIndex, columnIndex}){//注意这里是解构 //利用单元格的 className 的回调方法,给行列索引赋值 row.index=rowIndex; column.index=columnIndex; }, cellClick(row, column, cell, event){ console.log(row.index); console.log(column.index); } }
参数顺序是row, column, cell, event
这里的column,其实是cell,得到的是该行的html元素
打印
row[column.property]
才有值至于获取行列的索引,可以这样