I am new in vue and i want to display files after they dropped the file area. So far, i can took files and i can display them when they dropped file area in once. When i try to add another file, previous files disappearing because i am just assigning event files to input every time just like that :
this.$refs.file.files = e.dataTransfer.files;
So i believe if i can push the event files to input every time when dropped file, problem will solve.
So far i tried that but it's giving push is not a function error.
this.$refs.file.files.push(e.dataTransfer.files);
Sorry if you didn't understand me i can explain more. Can someone help me about it?
<input type="file" name="file" id="file" multiple ref="file" style="display:none;"
v-on:change="handleFileUpload()"/>
handleFileUpload Method:
handleFileUpload(e = null) {
this.$refs.file.files.push(e.dataTransfer.files);
for (let i = 0; i < this.$refs.file.files.length; i++) {
const reader = new FileReader();
reader.addEventListener('load', (event) => {
this.$refs.image[i].src = event.target.result
}, false);
reader.readAsDataURL(this.$refs.file.files[i]);
this.dragleave(e)
}}