Skip to content

Commit 6aee9cf

Browse files
committed
fix: styles
1 parent e833cf1 commit 6aee9cf

File tree

2 files changed

+40
-41
lines changed

2 files changed

+40
-41
lines changed

src/monaco/Monaco.vue

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,73 +9,73 @@ import * as monaco from 'monaco-editor';
99
import { setupThemePromise } from './utils';
1010
1111
interface Props {
12-
value?: string
13-
language?: string;
14-
readonly?: boolean
12+
value?: string
13+
language?: string;
14+
readonly?: boolean
1515
}
1616
1717
const props = withDefaults(defineProps<Props>(), {
18-
value: '',
19-
readonly: false
18+
value: '',
19+
readonly: false
2020
})
2121
2222
const emits = defineEmits<{
23-
(e: 'change', value: string): void,
24-
(e: 'save', value: string): void
23+
(e: 'change', value: string): void,
24+
(e: 'save', value: string): void
2525
}>()
2626
2727
const containerRef = ref<HTMLDivElement | null>();
2828
const ready = ref(false);
2929
const editor = shallowRef<monaco.editor.IStandaloneCodeEditor | undefined>(undefined);
3030
3131
onMounted(async () => {
32-
const theme = await setupThemePromise;
33-
ready.value = true;
34-
await nextTick();
32+
const theme = await setupThemePromise;
33+
ready.value = true;
34+
await nextTick();
3535
36-
if (!containerRef.value) {
37-
throw new Error("Cannot find containerRef");
38-
}
36+
if (!containerRef.value) {
37+
throw new Error("Cannot find containerRef");
38+
}
3939
40-
const editorInstance = monaco.editor.create(containerRef.value, {
41-
theme,
42-
value: props.value,
43-
language: props.language,
44-
readOnly: props.readonly,
45-
automaticLayout: true,
46-
scrollBeyondLastLine: false,
47-
minimap: {
48-
enabled: false,
49-
},
50-
inlineSuggest: {
51-
enabled: false,
52-
},
53-
});
54-
editor.value = editorInstance
40+
const editorInstance = monaco.editor.create(containerRef.value, {
41+
theme,
42+
value: props.value,
43+
language: props.language,
44+
readOnly: props.readonly,
45+
automaticLayout: true,
46+
scrollBeyondLastLine: false,
47+
minimap: {
48+
enabled: false,
49+
},
50+
inlineSuggest: {
51+
enabled: false,
52+
},
53+
});
54+
editor.value = editorInstance
5555
56-
await loadGrammars(editorInstance);
56+
await loadGrammars(editorInstance);
5757
58-
editorInstance.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS, () => {
59-
emits('save', editorInstance.getValue());
60-
});
58+
editorInstance.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS, () => {
59+
emits('save', editorInstance.getValue());
60+
});
6161
62-
editorInstance.onDidChangeModelContent(() => {
63-
emits('change', editorInstance.getValue());
64-
});
62+
editorInstance.onDidChangeModelContent(() => {
63+
emits('change', editorInstance.getValue());
64+
});
6565
});
6666
6767
watchEffect(() => {
68-
if (editor.value && editor.value.getValue() !== props.value) {
69-
editor.value.setValue(props.value);
70-
}
68+
if (editor.value && editor.value.getValue() !== props.value) {
69+
editor.value.setValue(props.value);
70+
}
7171
})
7272
7373
onBeforeUnmount(() => {
74-
editor.value?.dispose();
74+
editor.value?.dispose();
7575
});
7676
</script>
7777
<template>
78-
<div class="editor" ref="containerRef"></div>
78+
<div class="editor" ref="containerRef"></div>
7979
</template>
8080
<style>
8181
.editor {

src/output/Output.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ const mode = ref<OutputModes>(
4141
readonly
4242
:language="mode === 'css' ? 'css' : 'javascript'"
4343
:value="store.state.activeFile.compiled[mode]"
44-
4544
/>
4645
</div>
4746
</template>

0 commit comments

Comments
 (0)