运行命令快捷键

This commit is contained in:
fofolee 2022-03-30 18:31:56 +08:00
parent ac184cdad1
commit 1c7c3c95b8

View File

@ -114,7 +114,7 @@
</q-toolbar>
<q-card-section class="row items-center">
<pre
:class="runResultStatus ? 'text-green' : 'text-red'"
:class="runResultStatus ? '' : 'text-red'"
v-html="runResult"
></pre>
</q-card-section>
@ -160,6 +160,7 @@ export default {
},
methods: {
initEditor() {
let that = this;
this.editor = monaco.editor.create(
document.getElementById("monocaEditor"),
{
@ -174,6 +175,12 @@ export default {
},
}
);
this.editor.addCommand(
monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyB,
function () {
that.runCurrentCommand();
}
);
},
getEditorValue() {
return toRaw(this.editor).getValue();