vue input on change code example
Example 1: vue v-model
<input v-model="message" placeholder="edit me">
<p>Message is: {{ message }}</p>
Example 2: v-on:change vue
// It is important that the watch function be named the same as the data/computed property.
new Vue({
computed: {
parsedInput () {
return parse(this.userInput)
}
},
methods: {
process () {
serverProcess(this.parsedInput);
},
},
watch: {
parsedInput() {
this.process()
}
}
})