upload pictures with el-upload in elementUi, and then send the picture data and form data together to the post request to the backend. The form data can be obtained by the backend, but the image data has not been available. What is the reason?
<div class="item-pic-bg">
<img class="bgImg" :src="src" alt="">
<el-upload
class="upload"
accept="image/*"
:show-file-list="false"
action="/upload/uploadFile"
:on-success="handleSuccess">
<el-button type="primary" @click="refeshLoad()" class="refesh btnNoBorder button b2">
<i class="iconfont icon-shangchuan"></i>
</el-button>
</el-upload>
</div>
//
handleSuccess: function (response, file, fileList) {
this.src = file.url;
this.formData.files.push(file.raw);
},
//
saveIt: function () {
let formData = new FormData();
formData.append("files", this.formData.files);
//post
saveSlideShow(formData).then((res) => {
})
},