I am wondering how to use FileReader in vue js if I have to get images upload from two or more different input fields (tags). I have been copying and pasting the same code below to different functions in order to upload files but i think that there should be a better way.
bImage(event) {
let file = event.target.files[0];
let reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = event => {
this.form.images.push(event.target.result);
console.log(event.target.result);
};
},