错误 __webpack_require__.i(...) is not a function,请教的大神
网上复制的拍照预览代码,选择图片后报此错误:
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;
});
请问如何解决?