From 53c2af0bc0f602408024cd34eff7a25107b23f8e 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: Fri, 6 Dec 2024 09:45:07 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=8F=AA?= =?UTF-8?q?=E8=AF=BB=E6=A8=A1=E5=BC=8F=E5=AE=9E=E4=BE=8B=E5=8C=96=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E5=88=87=E6=8D=A2=E4=B8=BA=E7=BC=96=E8=BE=91=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E6=97=B6=E6=B2=A1=E6=9C=89=E5=B0=86=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=85=A5=E6=A0=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/simple-mind-map/index.js b/simple-mind-map/index.js index 353a06e1..6006e431 100644 --- a/simple-mind-map/index.js +++ b/simple-mind-map/index.js @@ -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) }