File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
ui/src/components/markdown Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 11<template >
2- <MdPreview noIconfont noPrettier :codeFoldable =" false" v-bind =" $attrs" />
2+ <MdPreview :language = " language " noIconfont noPrettier :codeFoldable =" false" v-bind =" $attrs" />
33</template >
44
55<script setup lang="ts">
6- import { MdPreview } from ' md-editor-v3'
6+ import { computed } from ' vue'
7+ import { MdPreview , config } from ' md-editor-v3'
8+ import { getBrowserLang } from ' @/locales/index'
9+ import useStore from ' @/stores'
10+ // 引入公共库中的语言配置
11+ import ZH_TW from ' @vavt/cm-extension/dist/locale/zh-TW'
12+
713defineOptions ({ name: ' MdPreview' })
14+ const { user } = useStore ()
15+ const language = computed (() => user .getLanguage () || getBrowserLang () || ' ' )
16+ config ({
17+ editorConfig: {
18+ languageUserDefined: {
19+ ' zh-Hant' : ZH_TW
20+ }
21+ }
22+ })
823 </script >
You can’t perform that action at this time.
0 commit comments