mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
feat: markdown优化
This commit is contained in:
parent
3c25c3767b
commit
babf9dbdb0
|
|
@ -27,7 +27,7 @@
|
|||
"katex": "^0.16.10",
|
||||
"lodash": "^4.17.21",
|
||||
"marked": "^12.0.2",
|
||||
"md-editor-v3": "4.12.1",
|
||||
"md-editor-v3": "^4.16.7",
|
||||
"medium-zoom": "^1.1.0",
|
||||
"mermaid": "^10.9.0",
|
||||
"mitt": "^3.0.0",
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@
|
|||
ref="editorRef"
|
||||
editorId="preview-only"
|
||||
:modelValue="item.str"
|
||||
noIconfont
|
||||
no-mermaid
|
||||
/>
|
||||
</template>
|
||||
</el-card>
|
||||
|
|
|
|||
|
|
@ -7,20 +7,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { MdEditor, config } from 'md-editor-v3'
|
||||
|
||||
import screenfull from 'screenfull'
|
||||
|
||||
import katex from 'katex'
|
||||
import 'katex/dist/katex.min.css'
|
||||
|
||||
import Cropper from 'cropperjs'
|
||||
import 'cropperjs/dist/cropper.css'
|
||||
|
||||
import mermaid from 'mermaid'
|
||||
|
||||
import highlight from 'highlight.js'
|
||||
import 'highlight.js/styles/atom-one-dark.css'
|
||||
import { MdEditor } from 'md-editor-v3'
|
||||
|
||||
// // <3.0
|
||||
// import prettier from 'prettier'
|
||||
|
|
@ -31,28 +18,4 @@ import 'highlight.js/styles/atom-one-dark.css'
|
|||
|
||||
// https://at.alicdn.com/t/c/font_2605852_u82y61ve02.js
|
||||
import './assets/iconfont.js'
|
||||
|
||||
config({
|
||||
editorExtensions: {
|
||||
// prettier: {
|
||||
// prettierInstance: prettier,
|
||||
// parserMarkdownInstance: parserMarkdown
|
||||
// },
|
||||
highlight: {
|
||||
instance: highlight
|
||||
},
|
||||
screenfull: {
|
||||
instance: screenfull
|
||||
},
|
||||
katex: {
|
||||
instance: katex
|
||||
},
|
||||
cropper: {
|
||||
instance: Cropper
|
||||
},
|
||||
mermaid: {
|
||||
instance: mermaid
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<template>
|
||||
<MdPreview
|
||||
noIconfont
|
||||
ref="editorRef"
|
||||
editorId="preview-only"
|
||||
:modelValue="item"
|
||||
|
|
|
|||
|
|
@ -10,6 +10,41 @@ import App from './App.vue'
|
|||
import router from '@/router'
|
||||
import Components from '@/components'
|
||||
import i18n from './locales'
|
||||
import { config } from 'md-editor-v3'
|
||||
|
||||
import screenfull from 'screenfull'
|
||||
|
||||
import katex from 'katex'
|
||||
import 'katex/dist/katex.min.css'
|
||||
|
||||
import Cropper from 'cropperjs'
|
||||
import 'cropperjs/dist/cropper.css'
|
||||
|
||||
import mermaid from 'mermaid'
|
||||
|
||||
import highlight from 'highlight.js'
|
||||
import 'highlight.js/styles/atom-one-dark.css'
|
||||
|
||||
config({
|
||||
editorExtensions: {
|
||||
highlight: {
|
||||
instance: highlight
|
||||
},
|
||||
screenfull: {
|
||||
instance: screenfull
|
||||
},
|
||||
katex: {
|
||||
instance: katex
|
||||
},
|
||||
cropper: {
|
||||
instance: Cropper
|
||||
},
|
||||
mermaid: {
|
||||
instance: mermaid
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const app = createApp(App)
|
||||
app.use(store)
|
||||
app.use(directives)
|
||||
|
|
|
|||
Loading…
Reference in New Issue