From 9ebae5cbf311dc5baec0a45a9dbfba51e4260a2c Mon Sep 17 00:00:00 2001 From: fofolee Date: Sat, 21 Dec 2024 21:34:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BF=AB=E6=8D=B7=E5=8A=A8?= =?UTF-8?q?=E4=BD=9C=E7=9A=84send=E4=BD=BF=E7=94=A8utools=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E6=8C=89=E9=92=AE=E9=87=8D=E6=96=B0=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/preload.js | 3 +- src/components/editor/CommandLanguageBar.vue | 216 +++++++++++++------ 2 files changed, 150 insertions(+), 69 deletions(-) diff --git a/plugin/preload.js b/plugin/preload.js index 481d488..481e84a 100644 --- a/plugin/preload.js +++ b/plugin/preload.js @@ -94,8 +94,7 @@ const shortCodes = [ electron.clipboard.writeText(text); }), (send = (text) => { - copyTo(text); - quickcommand.simulatePaste(); + utools.hideMainWindowTypeString(text); }), ]; diff --git a/src/components/editor/CommandLanguageBar.vue b/src/components/editor/CommandLanguageBar.vue index eb48c01..7957d8e 100644 --- a/src/components/editor/CommandLanguageBar.vue +++ b/src/components/editor/CommandLanguageBar.vue @@ -35,32 +35,34 @@
- + + + - - - - - - {{ - ["录制按键", "快捷动作", "查看文档"][index] - }} - @@ -130,7 +134,7 @@ program.ext === this.modelValue.customOptions.ext - ) + (program) => program.ext === this.modelValue.customOptions.ext + ); if (language.length) { - this.$emit('program-changed', language[0].name) + this.$emit("program-changed", language[0].name); } }, handleQuickCommandAction(index) { const actions = [ - () => this.showRecorder = true, - () => this.showActions = true, - () => this.showHelp() - ] - actions[index]() + () => (this.showRecorder = true), + () => (this.showActions = true), + () => this.showHelp(), + ]; + actions[index](); }, addAction(text) { - this.$emit('add-action', text) + this.$emit("add-action", text); }, showHelp() { - window.showUb.docs() - } + window.showUb.docs(); + }, + }, +}; + + +