vue markdown富文本

  1. vue引用富文本
  • npm i mavon-editor // yarn add mavon-editor
  • 对应文件引入
    HTML:

    js:
    import { mavonEditor } from 'mavon-editor'
    import 'mavon-editor/dist/css/index.css'
    components: { MDinput },
  1. mardown 转义HTML
  • npm i markdown-it // yarn add markdown-it
  • const md = require('markdown-it')()
    content.content = md.render(content.content)
    this.newsDetailsForm = content

你可能感兴趣的:(vue markdown富文本)