the image component of the elementui upload photo wall used in the project is adjusted with the backend, and the url returned to me by the backend is a string. To transmit multiple images, I need to stitch together each string myself. How do I delete the stitched string when I do the delete operation? how do I know which one is selected and which one to delete?
I use a custom upload method
uploadImage (e, res) {
let _this = this;
let reader = new FileReader();
reader.readAsDataURL(e.file);//base64
reader.onload = function(){
_this.imageName = e.file.name;
_this.imageData = reader.result.substring(reader.result.indexOf(",") + 1);//"data:image/png;base64,"
API.uploadImage({
imageName: _this.imageName,
imageData: _this.imageData,
}).then(response => {
if (response.success) {
_this.form.imageList.push(response.response);
_this.form.roUploadImageUrls = _this.form.imageList.join(",");
_this.$message.success("");
}
})
};
}
elementui
//
handleRemove(file, fileList) {
},