module.exports = {
// some nuxt config...
plugins: [
{ src: '~plugins/nuxt-quill-plugin.js', ssr:false}
],
// some nuxt config...
css: [
'quill/dist/quill.snow.css',
'quill/dist/quill.bubble.css',
'quill/dist/quill.core.css'
],
// some nuxt config...
}
然后在 plugins 文件夹中新建 nuxt-quill-plugin.js 文件,写入一下内容:
importVue from 'vue'
importVueQuillEditor from 'vue-quill-editor/dist/ssr'
Vue.use(VueQuillEditor)
然后在页面中调用:
v-if="editorOption"
class="quill-editor"
v-model="content"
@change="onEditorChange($event)"
@blur="onEditorBlur($event)"
@focus="onEditorFocus($event)"
@ready="onEditorReady($event)"
v-quill:myQuillEditor="editorOption">
感谢 @amoshydra 提供帮助
领取专属 10元无门槛券
私享最新 技术干货