Fix:修复只读模式实例化后再切换为编辑模式时没有将当前数据入栈的问题

This commit is contained in:
街角小林
2024-12-06 09:45:07 +08:00
parent 74d302639a
commit 53c2af0bc0

View File

@@ -491,6 +491,10 @@ class MindMap {
this.execCommand('CLEAR_ACTIVE_NODE')
}
this.opt.readonly = isReadonly
// 切换为编辑模式时,如果历史记录堆栈是空的,那么进行一次入栈操作
if (!isReadonly && this.command.history.length <= 0) {
this.command.originAddHistory()
}
this.emit('mode_change', mode)
}