美文网首页
nuxt使用markdown编辑器mavonEditor

nuxt使用markdown编辑器mavonEditor

作者: DaFengS | 来源:发表于2019-01-29 15:43 被阅读0次

插件的npm安装去看github,https://github.com/hinesboy/mavonEditor

1. plugins目录下创建js文件mavon-editor.js,内容如下


import Vue from 'vue'

import mavonEditor from 'mavon-editor'

Vue.use(mavonEditor)


2. nuxt.config.js 中,plugins和css位置添加配置如下


css: [

    '~/assets/style/app.styl',

    'mavon-editor/dist/css/index.css'

  ],

plugins: [

    {

      src: '@/plugins/mavon-editor',

      ssr: false

    }

  ]


ok,插件引入完成

3. 问题注意,css的引入,nuxt.config.js中,我使用的nuxt模板生成结构,所以有默认的css模块配置 '~/assets/style/app.styl',请注意这行css配置必须放在数组开始,否则可能出现莫名的样式问题

相关文章

网友评论

      本文标题:nuxt使用markdown编辑器mavonEditor

      本文链接:https://www.haomeiwen.com/subject/kwexsqtx.html