Browse Source

Tree: fix can not update children in some condition. (#1524)

FuryBean 8 năm trước cách đây
mục cha
commit
5285856100
1 tập tin đã thay đổi với 5 bổ sung5 xóa
  1. 5 5
      packages/tree/src/tree-node.vue

+ 5 - 5
packages/tree/src/tree-node.vue

@@ -163,17 +163,17 @@
       }
 
       const tree = this.tree;
-      const props = this.props || {};
+      if (!tree) {
+        console.warn('Can not find node\'s tree.');
+      }
+
+      const props = tree.props || {};
       const childrenKey = props['children'] || 'children';
 
       this.$watch(`node.data.${childrenKey}`, () => {
         this.node.updateChildren();
       });
 
-      if (!tree) {
-        console.warn('Can not find node\'s tree.');
-      }
-
       this.showCheckbox = tree.showCheckbox;
 
       if (this.node.expanded) {