Browse Source

Table: not throw error when calling toggleExpansion (#16304)

Inside 6 năm trước cách đây
mục cha
commit
625b4e9262
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      packages/table/src/store/tree.js

+ 2 - 2
packages/table/src/store/tree.js

@@ -166,8 +166,8 @@ export default {
       const { rowKey, treeData } = this.states;
       const id = getRowIdentity(row, rowKey);
       const data = id && treeData[id];
-      const oldExpanded = treeData[id].expanded;
-      if (id && data && 'expanded' in data) {
+      if (id && data && ('expanded' in data)) {
+        const oldExpanded = data.expanded;
         expanded = typeof expanded === 'undefined' ? !data.expanded : expanded;
         treeData[id].expanded = expanded;
         if (oldExpanded !== expanded) {