vue 引进quill-image-resize-module 报错 TypeError: Cannot read property 'imports' of undefined

vue 引进quill-image-resize-module 报错TypeError: Cannot read property 'imports' of undefined
at Object.eval (image-resize.min.js?f318:1)
at e (image-resize.min.js?f318:1)
at Object.eval (image-resize.min.js?f318:1)

vue 引进quill-image-resize-module 报错 TypeError: Cannot read property 'imports' of undefined

 

 

解决办法:

1、在根目录下新建vue.config.js 文件 (不是在src 下)

var webpack = require('webpack'); module.exports = {   // 在vue.config.js中configureWebpack中配置 // 要引入webpack

configureWebpack: {     plugins: [       new webpack.ProvidePlugin({         'window.Quill': 'quill/dist/quill.js',         'Quill': 'quill/dist/quill.js'       }),     ]   } }

 2、mian.js

import VueQuillEditor from 'vue-quill-editor' import 'quill/dist/quill.core.css' import 'quill/dist/quill.snow.css' import 'quill/dist/quill.bubble.css'    Vue.use(VueQuillEditor);   3、页面中 import { Quill } from 'vue-quill-editor' import { ImageDrop } from 'quill-image-drop-module' import ImageResize from 'quill-image-resize-module' Quill.register('modules/imageDrop', ImageDrop) Quill.register('modules/imageResize', ImageResize)   4、需要重新运行一下
上一篇:团队冲刺第三天-KeepRunningAPP


下一篇:报错需要选择一个空目录,或者选择的非空目录下存在 app.json 或者 project.config.json解决方案