element table表格没有获取勾选后的index的方法,这里通过两个forEach遍历实现。

当selection-change事件触发后,写入以下代码

    
       val.forEach((val, index) => {
      this.tableData.forEach((v, i) => {
       // id 是每一行的数据id
            if(val.id == v.id){
console.log(i);
}
})
})

打印出的 i 就是你要获取的勾选的行索引值,可以把它存到一个数组内,方便使用。

相关文章:

  • 2021-06-02
  • 2022-12-23
  • 2021-03-26
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2021-06-07
猜你喜欢
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2021-06-22
  • 2021-10-01
  • 2022-12-23
相关资源
相似解决方案