瀏覽代碼

bug修复

chenrui 3 年之前
父節點
當前提交
44eca10577
共有 1 個文件被更改,包括 9 次插入9 次删除
  1. 9 9
      src/components/Table/index.js

+ 9 - 9
src/components/Table/index.js

@@ -275,17 +275,17 @@ export default {
       if (selected) { //  选择
         this.selectedRows = [...this.selectedRows, ...changeRows]
       } else { //  取消
-        const arrId = []
-        this.selectedRows.map((item, index) => {
-          this.selectedRows.map((subItem, ind) => {
-            if (item[this.rowKeyName] == subItem[this.rowKeyName]) {
-              arrId.push(index)
-            }
-          })
+        const arrIds = []
+        changeRows.map((item, index) => {
+          arrIds.push(item[this.rowKeyName])
         })
-        arrId.map((item, index) => {
-          _this.selectedRows = _this.selectedRows.slice(item, item + 1)
+        const arrs = []
+        this.selectedRows.map((item, index) => {
+          if (arrIds.indexOf(item[this.rowKeyName]) == -1) {
+            arrs.push(item)
+          }
         })
+        this.selectedRows = arrs
       }
       this.updateSelect()
     },