From c2e7e17a216fa8da446612827008a5f1e7b6e917 Mon Sep 17 00:00:00 2001 From: KidneyFlower <753475777@qq.com> Date: Wed, 5 Dec 2018 16:30:21 +0800 Subject: [PATCH] Tree: fix a bug that caused `showCheckbox` props on `Tree` can not affect their children `tree-node` --- packages/tree/src/tree-node.vue | 8 +++++--- packages/tree/src/tree.vue | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/tree/src/tree-node.vue b/packages/tree/src/tree-node.vue index b77c5697f..23d0ab5ee 100644 --- a/packages/tree/src/tree-node.vue +++ b/packages/tree/src/tree-node.vue @@ -61,6 +61,7 @@ :render-content="renderContent" v-for="child in node.childNodes" :render-after-expand="renderAfterExpand" + :show-checkbox="showCheckbox" :key="getNodeKey(child)" :node="child" @node-expand="handleChildNodeExpand"> @@ -94,6 +95,10 @@ renderAfterExpand: { type: Boolean, default: true + }, + showCheckbox: { + type: Boolean, + default: false } }, @@ -127,7 +132,6 @@ tree: null, expanded: false, childNodeRendered: false, - showCheckbox: false, oldChecked: null, oldIndeterminate: null }; @@ -258,8 +262,6 @@ this.node.updateChildren(); }); - this.showCheckbox = tree.showCheckbox; - if (this.node.expanded) { this.expanded = true; this.childNodeRendered = true; diff --git a/packages/tree/src/tree.vue b/packages/tree/src/tree.vue index a5cae37a5..5b1c1b4c4 100644 --- a/packages/tree/src/tree.vue +++ b/packages/tree/src/tree.vue @@ -14,6 +14,7 @@ :node="child" :props="props" :render-after-expand="renderAfterExpand" + :show-checkbox="showCheckbox" :key="getNodeKey(child)" :render-content="renderContent" @node-expand="handleNodeExpand">