<!-- 富文本编辑器 -->
<template>
    <Editor v-model="editorValue" :init="config" />
</template>

<script lang="ts" setup>
import { computed } from 'vue'
import Editor from '@tinymce/tinymce-vue'

const props = defineProps({
    modelValue: {
        type: String,
        default: '',
    },
})

const emit = defineEmits(['update:modelValue'])

const editorValue = computed({
    get: () => props.modelValue,
    set: (val) => emit('update:modelValue', val)
})

const config = {
    language: 'zh-Hans',
    menubar: false,
    statusbar: false,
    width: '100%',
}
</script>