feat: 增加markdown编辑器
This commit is contained in:
parent
c095f6e6e2
commit
31ee6a4ae8
@ -28,7 +28,8 @@
|
|||||||
placeholder="请输入分段内容"
|
placeholder="请输入分段内容"
|
||||||
:maxLength="4096"
|
:maxLength="4096"
|
||||||
:preview="false"
|
:preview="false"
|
||||||
style="height: 300px;"
|
:toolbars="toolbars"
|
||||||
|
style="height: 300px"
|
||||||
/>
|
/>
|
||||||
<MdPreview v-else ref="editorRef" editorId="preview-only" :modelValue="form.content" />
|
<MdPreview v-else ref="editorRef" editorId="preview-only" :modelValue="form.content" />
|
||||||
<!-- <span v-else class="break-all lighter">{{ form.content }}</span> -->
|
<!-- <span v-else class="break-all lighter">{{ form.content }}</span> -->
|
||||||
@ -47,6 +48,37 @@ const props = defineProps({
|
|||||||
isEdit: Boolean
|
isEdit: Boolean
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const toolbars = [
|
||||||
|
'bold',
|
||||||
|
'underline',
|
||||||
|
'italic',
|
||||||
|
'-',
|
||||||
|
'title',
|
||||||
|
'strikeThrough',
|
||||||
|
'sub',
|
||||||
|
'sup',
|
||||||
|
'quote',
|
||||||
|
'unorderedList',
|
||||||
|
'orderedList',
|
||||||
|
'task',
|
||||||
|
'-',
|
||||||
|
'codeRow',
|
||||||
|
'code',
|
||||||
|
'link',
|
||||||
|
'image',
|
||||||
|
'table',
|
||||||
|
'mermaid',
|
||||||
|
'katex',
|
||||||
|
'-',
|
||||||
|
'revoke',
|
||||||
|
'next',
|
||||||
|
'=',
|
||||||
|
'pageFullscreen',
|
||||||
|
'preview',
|
||||||
|
'htmlPreview',
|
||||||
|
'catalog',
|
||||||
|
]
|
||||||
|
|
||||||
const form = ref<any>({
|
const form = ref<any>({
|
||||||
title: '',
|
title: '',
|
||||||
content: ''
|
content: ''
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user