table
点击按钮显示弹出框,弹出框中有个表格,表格可勾选,勾选后点击下一页,不能保留上一页的状态, 在页面中删除选项,再次打开表格不能正确显示,之前删除的选项,表格中还是勾选状态

table:tooltip-effect=”dark”,:row-key=”getRowKey”
getRowKey(row) {
return row[‘AUCTION.AUCTION_ID’];
},
table-column: 添加:reserve-selection=”true”
当点击弹出框确定按钮后回显到页面
table:@selection-change=”handleSelectionChange”
handleSelectionChange(list) {
this.auctionDialogList = list
},
点击确定按钮函数
this.auctionDialogListCache.push(...this.auctionDialogList);this.auctionDialogListCache = utils.arrayObjectDeduplication(this.auctionDialogListCache, "AUCTION.AUCTION_ID");const utils = {/*** 数组对象根据key去重* @param {*} list 要去重的数组对象* @param {*} key 根据哪个key去重*/arrayObjectDeduplication: function(list, key){let hash = {}return list.reduceRight((item, next) => {hash[next[key]] ? '' : hash[next[key]] = true && item.push(next);return item}, []);}}
显示弹出框
this.$nextTick(() => {// 清空所有勾选this.$refs.auctionMultipleTable.clearSelection()// 给现有元素设置勾选this.auctionDialogListCache.forEach(row => {this.$refs.auctionMultipleTable.toggleRowSelection(row, true);});});
