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