mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-15 23:54:35 +08:00
实现编排的插入、应用、运行功能
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user