Feat:只读模式下节点实例不保存nodeDataSnapshot数据
This commit is contained in:
parent
a55afdd252
commit
43c41e7ed2
@ -475,8 +475,12 @@ class MindMapNode {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.updateNodeActiveClass()
|
this.updateNodeActiveClass()
|
||||||
const { alwaysShowExpandBtn, notShowExpandBtn, isShowCreateChildBtnIcon } =
|
const {
|
||||||
this.mindMap.opt
|
alwaysShowExpandBtn,
|
||||||
|
notShowExpandBtn,
|
||||||
|
isShowCreateChildBtnIcon,
|
||||||
|
readonly
|
||||||
|
} = this.mindMap.opt
|
||||||
const childrenLength = this.getChildrenLength()
|
const childrenLength = this.getChildrenLength()
|
||||||
// 不显示展开收起按钮则不需要处理
|
// 不显示展开收起按钮则不需要处理
|
||||||
if (!notShowExpandBtn) {
|
if (!notShowExpandBtn) {
|
||||||
@ -522,7 +526,7 @@ class MindMapNode {
|
|||||||
// 更新节点位置
|
// 更新节点位置
|
||||||
const t = this.group.transform()
|
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) {
|
if (this.left !== t.translateX || this.top !== t.translateY) {
|
||||||
this.group.translate(this.left - t.translateX, this.top - t.translateY)
|
this.group.translate(this.left - t.translateX, this.top - t.translateY)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user