element 上传组件Uncaught TypeError: Cannot set property ‘status‘ of undefined 的原因和解决办法

查看控制台报错

断点调试

 

 

 

在这里调试我们发现,fileundefined。我们进到getFile函数看到,this.uploadFiles方法的值为,不能够进入到下面的every循环,而this.uploadFiles的值来自于父组件的fileList,所以我们就把错误定义到父组件中的fileList传值问题上。

 

 

1.可能是在el-upload钩子函数uploadChange做了文件过滤,将文件大小大于0的都进行了禁止上传。

2.使用了this.$refs.upload.clearFiles(),清空了当前的文件列表。

 

 

 


原文链接:https://blog.csdn.net/smoixan/article/details/109641179

posted @ 2021-07-27 17:25  如若菇凉  阅读(2549)  评论(0编辑  收藏  举报