From 3e78a0809b776081d6f56076770e3b8acba0e993 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Thu, 10 Nov 2022 16:19:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(editor):=20=E6=96=B0=E5=A2=9E=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E9=A1=B5=E9=9D=A2=E4=B8=8D=E5=BA=94=E8=AF=A5=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8E=86=E5=8F=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/editor/src/services/editor.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/editor/src/services/editor.ts b/packages/editor/src/services/editor.ts index c5888b76..f300009b 100644 --- a/packages/editor/src/services/editor.ts +++ b/packages/editor/src/services/editor.ts @@ -375,7 +375,9 @@ class Editor extends BaseService { } } - this.pushHistoryState(); + if (!isPage(newNodes[0])) { + this.pushHistoryState(); + } this.emit('add', newNodes); @@ -437,8 +439,10 @@ class Editor extends BaseService { await Promise.all(nodes.map((node) => this.doRemove(node))); - // 更新历史记录 - this.pushHistoryState(); + if (!isPage(nodes[0])) { + // 更新历史记录 + this.pushHistoryState(); + } this.emit('remove', nodes); }