68
rated 0 times
[
74]
[
6]
/ answers: 1 / hits: 76803
/ 7 Years ago, mon, january 23, 2017, 12:00:00
I can not use v-model
with file input, Vue says I must use v-on:change
. Ok so I can use v-on:change
, but how can I bind the content of the input file to a data
property?
Let's say I want to bind it in a component to this.file
:
export default {
data() {
file: null
},
// ...
}
Here is the HTML part:
<input id=image v-on:change=??? type=file>
<!-- ^- don't know how to bind without v-model -->
How should I do the binding?
More From » vue.js