vue2.0使用md-edit编辑器的过程

  # 使用 npm

  npm i @kangc/v-md-editor -S

  main.js基本配置

  import VueMarkdownEditor from '@kangc/v-md-editor';

  import '@kangc/v-md-editor/lib/style/base-editor.css';

  import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';

  import '@kangc/v-md-editor/lib/theme/style/vuepress.css';

  import Prism from 'prismjs';

  VueMarkdownEditor.use(vuepressTheme, {

  Prism,

  });

  /* 2、v-md-editor 代码块关键字高亮 */

  import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';

  import '@kangc/v-md-editor/lib/theme/style/github.css';

  // 引入所有语言包

  import hljs from 'highlight.js';

  VueMarkdownEditor.use(githubTheme, {

  Hljs: hljs,

  });

  /**

  * 3.创建行号

  */

  import createLineNumbertPlugin from '@kangc/v-md-editor/lib/plugins/line-number/index';

  VueMarkdownEditor.use(createLineNumbertPlugin());

  Vue.use(VueMarkdownEditor);