elementUI Table获取单击的是第几行和第几列

HTML部分 



JS部分 

//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);
    }
}

你可能感兴趣的:(elementui,vue.js)