mavonEditor基于Vue的markdown编辑器插件

mavonEditor基于Vue的markdown编辑器插件适用于博客系统。

安装

npm install mavon-editor -save-dev

引入

import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
// use
Vue.use(mavonEditor)
handleEditorImgAdd(pos, $file) {
  const blob = this.dataURItoBlob($file.miniurl);
  const formData = new FormData();
  formData.append("file", blob);
  // 发送请求上传图片
  upload(formData).then(res => {
    this.$refs.md.$img2Url(pos, res.data.path);
  });
},
handleEditorImgDel(pos) {
  delete this.imgFile[pos];
},
changeMarkdown(value, render) {
}

你可能感兴趣的:(前端)