diff --git a/src/components/MonocaEditor.vue b/src/components/MonocaEditor.vue index cc0c3b8..1f14137 100644 --- a/src/components/MonocaEditor.vue +++ b/src/components/MonocaEditor.vue @@ -28,19 +28,21 @@ export default { }, methods: { initEditor() { + let monacoEditorPreferences = { + value: "", + language: "javascript", + automaticLayout: true, + foldingStrategy: "indentation", + autoClosingBrackets: true, + tabSize: 2, + minimap: { + enabled: false, + }, + }; + if (this.$q.dark.isActive) monacoEditorPreferences.theme = "vs-dark"; this.editor = monaco.editor.create( document.getElementById("monocaEditor"), - { - value: "", - language: "javascript", - automaticLayout: true, - foldingStrategy: "indentation", - autoClosingBrackets: true, - tabSize: 2, - minimap: { - enabled: false, - }, - } + monacoEditorPreferences ); this.loadTypes(); this.registerLanguage();