Vue-SimpleMDE的使用

1、安装

npm install vue-simplemde --save-dev

2、在项目的main.js中引入

import VueSimplemde from 'vue-simplemde'
import 'simplemde/dist/simplemde.min.css'
Vue.use(VueSimplemde)

3、在Vue组建中使用

<template>
    <div class="markdown">
        <markdown-editor v-model="content"></markdown-editor>
    </div>
</template>

<script>
    import markdownEditor from 'vue-simplemde/src/markdown-editor';
    export default {
        components: { markdownEditor },
        data() {
            return {
                content: '',
                configs: {}
            };
        }
    }
</script>

<style scoped>
  .markdown{
      width: 60%;
      margin: 0 auto;
  }
</style>

猜你喜欢

转载自blog.csdn.net/sleepwalker_1992/article/details/82558248