fix: no voice in speech page; custom personal page redirect notworking. feat: sync sroll bar between question display page an obs component

This commit is contained in:
2024-11-23 18:46:37 +08:00
parent 14267bab3a
commit 47ade4a965
33 changed files with 838 additions and 1119 deletions

View File

@@ -0,0 +1,32 @@
<template>
<div ref="editorContainer" :style="`height: ${height}px;`"></div>
</template>
<script setup lang="ts">
import { editor } from 'monaco-editor'; // 全部导入
import { ref, onMounted } from 'vue';
const value = defineModel<string>('value')
const { language, height = 400 } = defineProps<{
language: string
height?: number
}>()
const editorContainer = ref()
onMounted(() => {
const e = editor.create(editorContainer.value, {
value: value.value,
language: language,
minimap: {
enabled: true
},
colorDecorators: true,
automaticLayout: true
})
e.onDidChangeModelContent(() => {
value.value = e.getValue()
})
})
</script>