1👍
✅
You can add a callback to the input
to listen for file changes.
First edit the html:
<input type="file" class="d-none" id="load-category-image" v-on:change="handleFileSelected">
Then you can handle what happens with the files selected in your component:
methods: {
loadImage($e){
//...
},
handleFileSelected(event) {
const files = document.getElementById('load-category-image').files;
console.log(files);
}
},
Source:stackexchange.com