解决方法:

:row-class-name="tableRowClassName"
@row-click="rowClick"

 

private tableRowClassName({row, rowIndex}: any) {
        // 把每一行的索引放进row
        row.index = rowIndex;
    }
private rowClick(row: any) {
        const index = row.index;
        this.tableData.forEach((item: any) => {
            item.isSelected = false;
        });
        row.isSelected = true;
        this.$set(this.tableData, index, row);
    }

 

相关文章:

  • 2022-12-23
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2023-01-03
  • 2022-12-23
  • 2021-04-17
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案