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?