diff --git a/packages/tree/src/tree-node.vue b/packages/tree/src/tree-node.vue index ab3f5144c..5f6c741d6 100644 --- a/packages/tree/src/tree-node.vue +++ b/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) {