feat: add markdown language
This commit is contained in:
parent
34b626d425
commit
f29c702700
@ -18,6 +18,7 @@
|
|||||||
"@ctrl/tinycolor": "^4.1.0",
|
"@ctrl/tinycolor": "^4.1.0",
|
||||||
"@logicflow/core": "^1.2.27",
|
"@logicflow/core": "^1.2.27",
|
||||||
"@logicflow/extension": "^1.2.27",
|
"@logicflow/extension": "^1.2.27",
|
||||||
|
"@vavt/cm-extension": "^1.6.0",
|
||||||
"@vueuse/core": "^10.9.0",
|
"@vueuse/core": "^10.9.0",
|
||||||
"@wecom/jssdk": "^2.1.0",
|
"@wecom/jssdk": "^2.1.0",
|
||||||
"axios": "^0.28.0",
|
"axios": "^0.28.0",
|
||||||
@ -46,10 +47,10 @@
|
|||||||
"vue": "^3.3.4",
|
"vue": "^3.3.4",
|
||||||
"vue-clipboard3": "^2.0.0",
|
"vue-clipboard3": "^2.0.0",
|
||||||
"vue-codemirror": "^6.1.1",
|
"vue-codemirror": "^6.1.1",
|
||||||
|
"vue-demi": "latest",
|
||||||
"vue-i18n": "^9.13.1",
|
"vue-i18n": "^9.13.1",
|
||||||
"vue-router": "^4.2.4",
|
"vue-router": "^4.2.4",
|
||||||
"vue3-menus": "^1.1.2",
|
"vue3-menus": "^1.1.2"
|
||||||
"vue-demi": "latest"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rushstack/eslint-patch": "^1.3.2",
|
"@rushstack/eslint-patch": "^1.3.2",
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<MdEditor noIconfont noPrettier v-bind="$attrs">
|
<MdEditor :language="language" noIconfont noPrettier v-bind="$attrs">
|
||||||
<template #defFooters>
|
<template #defFooters>
|
||||||
<slot name="defFooters"> </slot>
|
<slot name="defFooters"> </slot>
|
||||||
</template>
|
</template>
|
||||||
@ -7,8 +7,20 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { MdEditor } from 'md-editor-v3'
|
import { computed } from 'vue'
|
||||||
|
import { MdEditor, config } from 'md-editor-v3'
|
||||||
|
|
||||||
import './assets/markdown-iconfont.js'
|
import './assets/markdown-iconfont.js'
|
||||||
|
// 引入公共库中的语言配置
|
||||||
|
import ZH_TW from '@vavt/cm-extension/dist/locale/zh-TW'
|
||||||
|
|
||||||
defineOptions({ name: 'MdEditor' })
|
defineOptions({ name: 'MdEditor' })
|
||||||
|
const language = computed(() => localStorage.getItem('MaxKB-locale') || '')
|
||||||
|
config({
|
||||||
|
editorConfig: {
|
||||||
|
languageUserDefined: {
|
||||||
|
'zh-Hant': ZH_TW
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user