mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 14:48:19 +08:00
更新依赖,增加 mavon-editor
This commit is contained in:
@@ -1,23 +1,27 @@
|
||||
<template>
|
||||
<div>
|
||||
<page-main title="富文本编辑器">
|
||||
<editor v-model="form.content" />
|
||||
<div class="preview" v-html="form.content" />
|
||||
<editor v-model="content1" />
|
||||
<div class="preview" v-html="content1" />
|
||||
</page-main>
|
||||
<page-main title="markdown 编辑器">
|
||||
<mavon-editor v-model="content2" style="z-index: 9;" />
|
||||
<div class="preview" v-html="mdContent2" />
|
||||
</page-main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ComponentExampleEditor',
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
content: '<h1>Fantastic-admin</h1>'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<script setup>
|
||||
import { mavonEditor } from 'mavon-editor'
|
||||
import 'mavon-editor/dist/css/index.css'
|
||||
|
||||
const content1 = ref('<h1>Fantastic-admin</h1>')
|
||||
const content2 = ref('# Fantastic-admin')
|
||||
|
||||
const mdContent2 = computed(() => {
|
||||
const mdit = mavonEditor.getMarkdownIt()
|
||||
return mdit.render(content2.value)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user