From 43c41e7ed29314629bc2b4f7a023205fa4fc6fe8 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: Wed, 26 Mar 2025 11:56:57 +0800 Subject: [PATCH] =?UTF-8?q?Feat=EF=BC=9A=E5=8F=AA=E8=AF=BB=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E8=8A=82=E7=82=B9=E5=AE=9E=E4=BE=8B=E4=B8=8D?= =?UTF-8?q?=E4=BF=9D=E5=AD=98nodeDataSnapshot=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/core/render/node/MindMapNode.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/simple-mind-map/src/core/render/node/MindMapNode.js b/simple-mind-map/src/core/render/node/MindMapNode.js index 34148a8a..3cf924f8 100644 --- a/simple-mind-map/src/core/render/node/MindMapNode.js +++ b/simple-mind-map/src/core/render/node/MindMapNode.js @@ -475,8 +475,12 @@ class MindMapNode { return } this.updateNodeActiveClass() - const { alwaysShowExpandBtn, notShowExpandBtn, isShowCreateChildBtnIcon } = - this.mindMap.opt + const { + alwaysShowExpandBtn, + notShowExpandBtn, + isShowCreateChildBtnIcon, + readonly + } = this.mindMap.opt const childrenLength = this.getChildrenLength() // 不显示展开收起按钮则不需要处理 if (!notShowExpandBtn) { @@ -522,7 +526,7 @@ class MindMapNode { // 更新节点位置 const t = this.group.transform() // 保存一份当前节点数据快照 - this.nodeDataSnapshot = JSON.stringify(this.getData()) + this.nodeDataSnapshot = readonly ? '' : JSON.stringify(this.getData()) // 节点位置变化才更新,因为即使值没有变化属性设置操作也是耗时的 if (this.left !== t.translateX || this.top !== t.translateY) { this.group.translate(this.left - t.translateX, this.top - t.translateY)