使用Vue-SimpleMDE 编辑器

2017-03-31  本文已影响1143人  洋__

girhub地址 https://github.com/F-loat/vue-simplemde.git

使用步骤

  1. 进入项目目录,安装插件依赖
npm install vue-simplemde --save
  1. 在main.js引入
import VueSimplemde from 'vue-simplemde'
Vue.use(VueSimplemde)
  1. 编辑vue文件
<template>
    <markdown-editor v-model="content" ref="markdownEditor"></markdown-editor>
</template>
<script>
    import { markdownEditor } from 'vue-simplemde'
    // 基础用法
export default {
  components: {
    markdownEditor
  },
  data () {
    return {
      content: '',
      configs: {
        spellChecker: false // 禁用拼写检查
      }
    }
  }
}
</script>

4.运行如下

Paste_Image.png
  1. 整合demo地址
    https://github.com/ssdpj/mk/tree/vue-admine
上一篇 下一篇

猜你喜欢

热点阅读