From a1c0de83f013dddac6c5c46a4b8ba954edd43fcd Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Mon, 1 Aug 2022 17:45:20 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/dv/apps/components/vue-okr-tree/OkrTreeNode.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/project/dv/apps/components/vue-okr-tree/OkrTreeNode.vue b/project/dv/apps/components/vue-okr-tree/OkrTreeNode.vue index 23bb648a..0099cdc1 100644 --- a/project/dv/apps/components/vue-okr-tree/OkrTreeNode.vue +++ b/project/dv/apps/components/vue-okr-tree/OkrTreeNode.vue @@ -240,7 +240,7 @@ export default { return ( (this.tree.store.direction === "horizontal" && this.showCollapsable && - this.leftChildNodes.length > 0) + this.leftChildNodes.length > 0) ) }, // 节点的宽度 @@ -356,6 +356,11 @@ export default { this.node.collapse(); this.tree.$emit("node-collapse", this.node.data, this.node, this); } else { + if (this.node.parent.childNodes && this.node.parent.childNodes.length) { + this.node.parent.childNodes.forEach(e => { + e.collapse() + }) + } this.node.expand(); this.tree.$emit("node-expand", this.node.data, this.node, this); }