Browse Source

修复bug

DESKTOP-0GD05B0\Administrator 2 years ago
parent
commit
8733a3f8bf
1 changed files with 7 additions and 15 deletions
  1. 7 15
      src/components/xiao-chan/xc-table/XcTable.vue

+ 7 - 15
src/components/xiao-chan/xc-table/XcTable.vue

@@ -135,24 +135,16 @@ const selectionChange = (selection) => {
   emit('selectionChange', selection)
 }
 
-const tempRow = ref({})
 const rowClick = (row, column, event) => {
-  if (row.children) {
-    for (let i = 0, len = row.children.length; i < len; i++) {
-      tableRef.value.toggleRowSelection(row.children[i])
+  nextTick(() => {
+    tableRef.value.toggleRowSelection(row)
+    if (row.children) {
+      for (let i = 0, len = row.children.length; i < len; i++) {
+        tableRef.value.toggleRowSelection(row.children[i])
+      }
     }
-  }
-  tableRef.value.toggleRowSelection(row)
+  })
   emit('rowClick', row, column, event);
-  if (tempRow.value) {
-    // 防止多次点击触发事件
-    if (tempRow.value === row) {
-      return
-    }
-    tempRow.value['$show'] = false
-  }
-  row['$show'] = true
-  tempRow.value = row
 }
 
 /**