From 697e53ff7d4c8832b0c9245595ae033479613014 Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Fri, 13 Oct 2023 11:16:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96=EF=BC=9A?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E5=8F=B3=E9=94=AE=E4=BA=8B=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=9C=89=E4=B8=94=E5=8F=AA=E6=9C=89=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E8=8A=82=E7=82=B9=E8=A2=AB=E6=BF=80=E6=B4=BB=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=86=8D=E9=87=8D=E5=A4=8D=E6=BF=80=E6=B4=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/core/render/node/Node.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/simple-mind-map/src/core/render/node/Node.js b/simple-mind-map/src/core/render/node/Node.js index 8c83ad0e..ea7eb8f8 100644 --- a/simple-mind-map/src/core/render/node/Node.js +++ b/simple-mind-map/src/core/render/node/Node.js @@ -129,7 +129,7 @@ class Node { }) // 协同相关 if (this.mindMap.cooperate) { - Object.keys(nodeCooperateMethods).forEach((item) => { + Object.keys(nodeCooperateMethods).forEach(item => { this[item] = nodeCooperateMethods[item].bind(this) }) } @@ -491,10 +491,16 @@ class Node { ) { return } - if (this.nodeData.data.isActive) { + // 如果有且只有当前节点激活了,那么不需要重新激活 + if ( + !( + this.nodeData.data.isActive && + this.renderer.activeNodeList.length === 1 + ) + ) { this.renderer.clearActiveNodeList() + this.active(e) } - this.active(e) this.mindMap.emit('node_contextmenu', e, this) }) }