第一种方法:将index放到row数据中

首先,给table加一个属性::row-class-name="tableRowClassName"

然后定义tableRowClassName函数:(tableRowClassName可以自己改名)

tableRowClassName({row, rowIndex}) {
	row.row_index = rowIndex;
}

然后给表格添加: @row-click = "onRowClick"

onRowClick (row, event, column) {
	this.currentRowIndex = row.row_index;
}

这时,属性:currentRowIndex存的就是当前选中行的index了

相关文章:

  • 2022-02-18
  • 2022-12-23
  • 2022-01-29
  • 2021-07-09
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2021-08-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
相关资源
相似解决方案