精简 monaco 相关代码

This commit is contained in:
fofolee 2022-04-20 15:20:41 +08:00
parent b33f4b16eb
commit 688b3b09f5
4 changed files with 5 additions and 15 deletions

View File

@ -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() {

View File

@ -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"

View File

@ -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>

View File

@ -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;
}