1.在项目中安装mavon-editor
npm install mavon-editor --save
2.引入mavon-editor组件及样式
import {mavonEditor} from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
3.将mavon-editor注册为子组件
// 注册为子组件
components: {
mavonEditor
},
4.使用mavon-editor渲染出markdown编辑器
<el-form-item label="内容:">
<mavonEditor v-model="formData.mdContent" />
</el-form-item>