v-model
can't be used in a file input. Because, v-model
would try to set the “value” of the input, which is not possible for file inputs. Also, you would have to process the FileList Object anyway.<input type="file", @change="processFile($event)">
JavaScript:methods: {
processFile(event) {
this.someData = event.target.files[0]
}
}
Labels: JavaScript, VueJs