diff --git a/src/components/CommandEditor.vue b/src/components/CommandEditor.vue index 08c3f6f..97170ca 100644 --- a/src/components/CommandEditor.vue +++ b/src/components/CommandEditor.vue @@ -38,7 +38,7 @@ @program-changed="programChanged" @run="runCurrentCommand" @save="saveCurrentCommand" - @add-action="insertText" + @use-composer="handleComposer" /> @@ -196,6 +196,16 @@ export default { insertText(text) { this.$refs.editor.repacleEditorSelection(text); }, + handleComposer({ type, code }) { + switch (type) { + case "run": + return this.runCurrentCommand(code); + case "insert": + return this.insertText(code); + case "apply": + return this.$refs.editor.setEditorValue(code); + } + }, // 保存 saveCurrentCommand(message = "保存成功") { let updatedData = this.$refs.sidebar?.SaveMenuData(); diff --git a/src/components/editor/CommandLanguageBar.vue b/src/components/editor/CommandLanguageBar.vue index cab6f90..877ef34 100644 --- a/src/components/editor/CommandLanguageBar.vue +++ b/src/components/editor/CommandLanguageBar.vue @@ -39,8 +39,8 @@ @@ -162,17 +163,16 @@ - + + @@ -180,15 +180,15 @@