From 78a242faff7c2bc8ad5469fb44c50bd4497f4442 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: Wed, 11 Dec 2024 18:19:47 +0800 Subject: [PATCH] =?UTF-8?q?Feat=EF=BC=9A=E6=96=B0=E5=A2=9E=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E5=BF=AB=E6=8D=B7=E9=94=AE=E5=86=85=E9=83=A8=E9=94=AE?= =?UTF-8?q?=E5=80=BC=E6=98=A0=E5=B0=84=E5=AF=B9=E8=B1=A1=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/core/command/KeyCommand.js | 12 ++++++++++++ web/src/pages/Edit/components/Edit.vue | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/simple-mind-map/src/core/command/KeyCommand.js b/simple-mind-map/src/core/command/KeyCommand.js index 2e8d7049..9997bd77 100644 --- a/simple-mind-map/src/core/command/KeyCommand.js +++ b/simple-mind-map/src/core/command/KeyCommand.js @@ -16,6 +16,18 @@ export default class KeyCommand { this.bindEvent() } + // 扩展按键映射 + extendKeyMap(key, code) { + keyMap[key] = code + } + + // 从按键映射中删除某个键 + removeKeyMap(key) { + if (typeof keyMap[key] !== 'undefined') { + delete keyMap[key] + } + } + // 暂停快捷键响应 pause() { this.isPause = true diff --git a/web/src/pages/Edit/components/Edit.vue b/web/src/pages/Edit/components/Edit.vue index 7545a0c6..2a71e270 100644 --- a/web/src/pages/Edit/components/Edit.vue +++ b/web/src/pages/Edit/components/Edit.vue @@ -17,7 +17,10 @@ - + @@ -123,7 +126,7 @@ import NodeAttachment from './NodeAttachment.vue' import NodeOuterFrame from './NodeOuterFrame.vue' import NodeTagStyle from './NodeTagStyle.vue' import Setting from './Setting.vue' -import AssociativeLineStyle from './AssociativeLineStyle.vue'; +import AssociativeLineStyle from './AssociativeLineStyle.vue' // 注册插件 MindMap.usePlugin(MiniMap)