mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: add markdown language
This commit is contained in:
parent
34b626d425
commit
f29c702700
|
|
@ -18,6 +18,7 @@
|
|||
"@ctrl/tinycolor": "^4.1.0",
|
||||
"@logicflow/core": "^1.2.27",
|
||||
"@logicflow/extension": "^1.2.27",
|
||||
"@vavt/cm-extension": "^1.6.0",
|
||||
"@vueuse/core": "^10.9.0",
|
||||
"@wecom/jssdk": "^2.1.0",
|
||||
"axios": "^0.28.0",
|
||||
|
|
@ -46,10 +47,10 @@
|
|||
"vue": "^3.3.4",
|
||||
"vue-clipboard3": "^2.0.0",
|
||||
"vue-codemirror": "^6.1.1",
|
||||
"vue-demi": "latest",
|
||||
"vue-i18n": "^9.13.1",
|
||||
"vue-router": "^4.2.4",
|
||||
"vue3-menus": "^1.1.2",
|
||||
"vue-demi": "latest"
|
||||
"vue3-menus": "^1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rushstack/eslint-patch": "^1.3.2",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<MdEditor noIconfont noPrettier v-bind="$attrs">
|
||||
<MdEditor :language="language" noIconfont noPrettier v-bind="$attrs">
|
||||
<template #defFooters>
|
||||
<slot name="defFooters"> </slot>
|
||||
</template>
|
||||
|
|
@ -7,8 +7,20 @@
|
|||
</template>
|
||||
|
||||
<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 ZH_TW from '@vavt/cm-extension/dist/locale/zh-TW'
|
||||
|
||||
defineOptions({ name: 'MdEditor' })
|
||||
const language = computed(() => localStorage.getItem('MaxKB-locale') || '')
|
||||
config({
|
||||
editorConfig: {
|
||||
languageUserDefined: {
|
||||
'zh-Hant': ZH_TW
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue