<template>
<div class="upload">
<form enctype="multipart/form-data" @submit.prevent="submitForm">
<input type="file" name="avatar" @change="avatarChange" /><br />
<input type="file" multiple name="imageProduct" @change="changeProduct" /><br />
<input type="file" multiple name="imageInvoice" @change="changeInvoice" /><br />
</form>
</div>
</template>
data () {
return: {
imageProduct: [],
avatar: null,
imageInvoice: [],
}
},
methods: {
avatarChange() {
let avatar = e.target.files[0];
this.avatar = avatar;
}
changeProduct() {
//
}
changeInvoice() {
//
},
submitForm() {
// pass image value through laravel through axios
}
}
Is there a way to combine these three methods together, and get the information of single image input and multiple image input at the same time? Thanks.