element el-table 点击某一行 改变数据未及时刷新的问题
时间:2020-06-19 18:56:06
收藏:0
阅读:1784
解决方法:
: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); }
原文:https://www.cnblogs.com/jiaqi1719/p/13164379.html
评论(0)