From b40da53aef1b768b3fb69da4be23468b8f0d3ddb Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Tue, 17 Jan 2023 15:49:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E8=AF=BB=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E6=B7=BB=E5=8A=A0=E5=8E=86=E5=8F=B2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E3=80=81=E7=A6=81=E6=AD=A2=E5=93=8D=E5=BA=94=E5=89=8D?= =?UTF-8?q?=E8=BF=9B=E5=90=8E=E9=80=80=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/Command.js | 9 +++++++++ web/src/pages/Doc/catalogList.js | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/simple-mind-map/src/Command.js b/simple-mind-map/src/Command.js index fa31d6ff..f7d85b15 100644 --- a/simple-mind-map/src/Command.js +++ b/simple-mind-map/src/Command.js @@ -72,6 +72,9 @@ class Command { // 添加回退数据 addHistory() { + if (this.mindMap.opt.readonly) { + return + } let data = this.getCopyData() this.history.push(simpleDeepClone(data)) this.activeHistoryIndex = this.history.length - 1 @@ -85,6 +88,9 @@ class Command { // 回退 back(step = 1) { + if (this.mindMap.opt.readonly) { + return + } if (this.activeHistoryIndex - step >= 0) { this.activeHistoryIndex -= step this.mindMap.emit( @@ -98,6 +104,9 @@ class Command { // 前进 forward(step = 1) { + if (this.mindMap.opt.readonly) { + return + } let len = this.history.length if (this.activeHistoryIndex + step <= len - 1) { this.activeHistoryIndex += step diff --git a/web/src/pages/Doc/catalogList.js b/web/src/pages/Doc/catalogList.js index 4364435c..56005a44 100644 --- a/web/src/pages/Doc/catalogList.js +++ b/web/src/pages/Doc/catalogList.js @@ -16,15 +16,15 @@ let APIList = [ 'node', 'render', 'view', - 'miniMap', - 'doExport', - 'watermark', 'keyCommand', - 'keyboardNavigation', 'command', + 'batchExecution', 'select', 'drag', - 'batchExecution', + 'keyboardNavigation', + 'doExport', + 'miniMap', + 'watermark', 'xmind', 'utils' ]