From 29695d1d7e697812ff096a1210b9579e9527de73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=97=E8=A7=92=E5=B0=8F=E6=9E=97?= <1013335014@qq.com> Date: Mon, 30 Sep 2024 17:35:26 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E6=B4=BE?= =?UTF-8?q?=E5=8F=91=E8=8A=82=E7=82=B9=E6=BF=80=E6=B4=BB=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=8C=E5=8E=BB=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E5=BF=85=E8=A6=81=E7=9A=84=E5=88=A4=E6=96=AD=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E6=BF=80=E6=B4=BB=E8=8A=82=E7=82=B9=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E6=94=B9=E5=8F=98=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E4=B9=9F?= =?UTF-8?q?=E4=BC=9A=E8=A7=A6=E5=8F=91=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/core/render/Render.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/simple-mind-map/src/core/render/Render.js b/simple-mind-map/src/core/render/Render.js index 85a51dc6..bc38cc14 100644 --- a/simple-mind-map/src/core/render/Render.js +++ b/simple-mind-map/src/core/render/Render.js @@ -102,7 +102,6 @@ class Render { this.highlightBoxNode = null this.highlightBoxNodeStyle = null // 上一次节点激活数据 - this.lastActiveNode = null this.lastActiveNodeList = [] // 布局 this.setLayout() @@ -435,13 +434,11 @@ class Render { // 派发节点激活事件 emitNodeActiveEvent(node = null, activeNodeList = [...this.activeNodeList]) { - let isChange = false - isChange = this.lastActiveNode !== node - if (!isChange) { - isChange = !checkNodeListIsEqual(this.lastActiveNodeList, activeNodeList) - } + const isChange = !checkNodeListIsEqual( + this.lastActiveNodeList, + activeNodeList + ) if (!isChange) return - this.lastActiveNode = node this.lastActiveNodeList = [...activeNodeList] this.mindMap.batchExecution.push('emitNodeActiveEvent', () => { this.mindMap.emit('node_active', node, activeNodeList)