Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 780 Bytes

markdown.md

File metadata and controls

35 lines (27 loc) · 780 Bytes

Markdown-It

获取mavonEditor中的markdown-it对象

方法1 通过全局引入的mavonEditor获取

  import mavonEditor from 'mavon-editor'
  Vue.use(mavonEditor)
  ...
  mavonEditor.markdownIt

方法2 通过局部引入的mavonEditor获取

  import {mavonEditor} from 'mavon-editor'
  mavonEditor.mixins[0].data().s_markdown

方法3 通过mavonEditor的实例获取

   <mavonEditor ref=md></mavonEditor>
   ...
   this.refs.md.s_markdown

使用markdown-it对象

设置markdown换行格式必须为行尾添加两空格

    // markdownIt通过上述方式获取
    markdownIt.set({ breaks: false });

更多设置参考markdown-it...