vue项目使用markdown编辑器

1.安装mavon-editor

$ npm install mavon-editor --save

2.

需要使用Markdown编辑器的页面js中:

 import { mavonEditor } from 'mavon-editor'
 import 'mavon-editor/dist/css/index.css'

 export default {
      components: {
        mavonEditor
      }
 }

html:

<mavonEditor v-model="content" ref="md" @imgAdd="$imgAdd"  @change="changeMavon"/>

js:

 data(){
    return{
       content:'',
           configs:{

           }
        }
    },
    components:{
        mavonEditor
    },
    methods:{
        changeMavon(){

        },
        $imgAdd(){
            
        }
    }

猜你喜欢

转载自blog.csdn.net/Lei_zhen96/article/details/82022875