mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-08 11:26:56 +08:00
chore: format code style and update linting configuration
This commit is contained in:
@@ -1,22 +1,14 @@
|
||||
<template>
|
||||
<div
|
||||
ref="editorContainer"
|
||||
:style="`height: ${height}px;`"
|
||||
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { editor } from 'monaco-editor'; // 全部导入
|
||||
import { ref, onMounted, onBeforeUnmount, watch } from 'vue';
|
||||
|
||||
const value = defineModel<string>('value')
|
||||
import { editor } from 'monaco-editor' // 全部导入
|
||||
import { onBeforeUnmount, onMounted, ref, watch } from 'vue'
|
||||
|
||||
const { language, height = 400 } = defineProps<{
|
||||
language: string
|
||||
height?: number
|
||||
}>()
|
||||
|
||||
const value = defineModel<string>('value')
|
||||
|
||||
const editorContainer = ref<HTMLElement>()
|
||||
let editorInstance: editor.IStandaloneCodeEditor | null = null
|
||||
|
||||
@@ -25,12 +17,12 @@ onMounted(() => {
|
||||
|
||||
editorInstance = editor.create(editorContainer.value, {
|
||||
value: value.value,
|
||||
language: language,
|
||||
language,
|
||||
minimap: {
|
||||
enabled: true
|
||||
enabled: true,
|
||||
},
|
||||
colorDecorators: true,
|
||||
automaticLayout: true
|
||||
automaticLayout: true,
|
||||
})
|
||||
|
||||
editorInstance.onDidChangeModelContent(() => {
|
||||
@@ -64,4 +56,11 @@ watch(() => language, (newLang) => {
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
ref="editorContainer"
|
||||
:style="`height: ${height}px;`"
|
||||
/>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user