错误 __webpack_require__.i(...) is not a function,请教的大神

weixin_38085383 2017-08-24 09:51:30
网上复制的拍照预览代码,选择图片后报此错误: Capture.vue?fe60:89 Uncaught TypeError: webpack_require.i(…) is not a function at VueComponent.createImage (Capture.vue?fe60:89) at VueComponent.boundFn [as createImage] (vue.esm.js?71e4:181) at VueComponent.onFileChange (Capture.vue?fe60:85) at boundFn (vue.esm.js?71e4:182) at HTMLInputElement.invoker (vue.esm.js?71e4:1814) 代码: 请选择或者拍照上传照片 <input type="file" accept="image/jpeg,image/jpg,image/png" capture="camera" v-on:change="onFileChange" style="display: none;"> .image-list { padding: 0.24rem; font-size: 20px; text-align: center; background-color: #ddd; } .p-title{ margin-bottom: 0.3rem; } .list-ul{ background-color: #3DD; height: 3rem; width: 100%; } 出错位置(加粗): createImage: function(file, e) { let vm = this; lrz(file[0], { width: 480 }).then(function(rst) { vm.imgUrls.push(rst.base64); return rst; }).always(function() { // 清空文件上传控件的值 e.target.value = null; }); 请问如何解决?
...全文
447 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_38097244 2017-08-26
  • 打赏
  • 举报
回复
如果是import该require 不行加 typeof window !== ‘undefined’

433

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧