使用<input
type="file"
ref="clearFile"
style="display:none"
@change="uploadImg($event)"
class="add-file-right-input"
accept="image/png,image/jpeg,image/gif,image/jpg"
/>上传文件
uploadImg(e) {
let file = e.target.files || e.dataTransfer.files; //target事件
console.log("=======file=====", file);
this.uploadBackstage(file);
// this.$refs.clearFile.value = ""; //上传文件后重置
},
打印出来的file是空数组,请问怎么解决
0 个回复