<template>
  <div v-if="!$attrs.modelValue"></div>
  <MdPreview v-else noIconfont noPrettier :codeFoldable="false" v-bind="$attrs"/>
</template>

<script setup>
import { MdPreview, config } from 'md-editor-v3'
// 引入公共库中的语言配置
import ZH_TW from '@vavt/cm-extension/dist/locale/zh-TW'

defineOptions({ name: 'MdPreview' })
config({
  editorConfig: {
    languageUserDefined: {
      'zh-Hant': ZH_TW
    }
  },
})
</script>
