File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 1818 "@ctrl/tinycolor" : " ^4.1.0" ,
1919 "@logicflow/core" : " ^1.2.27" ,
2020 "@logicflow/extension" : " ^1.2.27" ,
21+ "@vavt/cm-extension" : " ^1.6.0" ,
2122 "@vueuse/core" : " ^10.9.0" ,
2223 "@wecom/jssdk" : " ^2.1.0" ,
2324 "axios" : " ^0.28.0" ,
4647 "vue" : " ^3.3.4" ,
4748 "vue-clipboard3" : " ^2.0.0" ,
4849 "vue-codemirror" : " ^6.1.1" ,
50+ "vue-demi" : " latest" ,
4951 "vue-i18n" : " ^9.13.1" ,
5052 "vue-router" : " ^4.2.4" ,
51- "vue3-menus" : " ^1.1.2" ,
52- "vue-demi" : " latest"
53+ "vue3-menus" : " ^1.1.2"
5354 },
5455 "devDependencies" : {
5556 "@rushstack/eslint-patch" : " ^1.3.2" ,
Original file line number Diff line number Diff line change 11<template >
2- <MdEditor noIconfont noPrettier v-bind =" $attrs" >
2+ <MdEditor :language = " language " noIconfont noPrettier v-bind =" $attrs" >
33 <template #defFooters >
44 <slot name =" defFooters" > </slot >
55 </template >
66 </MdEditor >
77</template >
88
99<script setup lang="ts">
10- import { MdEditor } from ' md-editor-v3'
10+ import { computed } from ' vue'
11+ import { MdEditor , config } from ' md-editor-v3'
1112
1213import ' ./assets/markdown-iconfont.js'
14+ // 引入公共库中的语言配置
15+ import ZH_TW from ' @vavt/cm-extension/dist/locale/zh-TW'
16+
1317defineOptions ({ name: ' MdEditor' })
18+ const language = computed (() => localStorage .getItem (' MaxKB-locale' ) || ' ' )
19+ config ({
20+ editorConfig: {
21+ languageUserDefined: {
22+ ' zh-Hant' : ZH_TW
23+ }
24+ }
25+ })
1426 </script >
You can’t perform that action at this time.
0 commit comments