瀏覽代碼

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

FuryBean 8 年之前
父節點
當前提交
5285856100
共有 1 個文件被更改,包括 5 次插入5 次删除
  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) {