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)