data() {
return {
formData: {
product_id: '',
title: '',
description: '',
subsets: [],
}
}
}
// create FormData instance to pass to backend
let fData = new FormData();
fData.append('title', this.formData.title)
fData.append('description', this.formData.description);
for (let i=0; i<this.formData.files.length; i++) {
fData.append('files', this.formData.files[i]);
}
for (let i=0; i<this.formData.subsets.length; i++) {
fData.append('subsets', this.formData.subsets[i]);
}
fData.append('product_id', this.selected_product.id);
网友评论