mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 22:51:25 +08:00
精简 monaco 相关代码
This commit is contained in:
parent
b33f4b16eb
commit
688b3b09f5
@ -327,13 +327,6 @@ export default {
|
||||
this.matchLanguage(this.quickcommandInfo.customOptions.ext);
|
||||
});
|
||||
},
|
||||
closeEditor() {
|
||||
this.$refs.editor?.destoryEditor();
|
||||
this.$emit("editorEvent", {
|
||||
type: "close",
|
||||
data: {},
|
||||
});
|
||||
},
|
||||
// 保存
|
||||
saveCurrentCommand() {
|
||||
let updatedData = this.$refs.sidebar?.SaveMenuData();
|
||||
@ -348,7 +341,6 @@ export default {
|
||||
type: "save",
|
||||
data: newQuickcommandInfo,
|
||||
});
|
||||
this.closeEditor();
|
||||
},
|
||||
// 运行
|
||||
runCurrentCommand() {
|
||||
|
@ -14,7 +14,7 @@
|
||||
color="grey"
|
||||
style="margin-right: 29px"
|
||||
icon="arrow_back_ios_new"
|
||||
@click="$parent.closeEditor"
|
||||
v-close-popup
|
||||
/>
|
||||
<q-img
|
||||
class="commandLogo"
|
||||
|
@ -204,9 +204,6 @@ export default {
|
||||
};
|
||||
this.rawEditor.executeEdits("my-source", [op]);
|
||||
},
|
||||
destoryEditor() {
|
||||
this.rawEditor.dispose();
|
||||
},
|
||||
listenEditorValue() {
|
||||
this.rawEditor.focus();
|
||||
this.rawEditor.onDidChangeModelContent(() => {
|
||||
@ -237,6 +234,9 @@ export default {
|
||||
);
|
||||
},
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.rawEditor.dispose();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -576,11 +576,9 @@ export default {
|
||||
},
|
||||
editorEvent(event) {
|
||||
switch (event.type) {
|
||||
case "close":
|
||||
this.isCommandEditorShow = false;
|
||||
return;
|
||||
case "save":
|
||||
this.saveCommand(event.data);
|
||||
this.isCommandEditorShow = false;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user