0π
β
You can use Watchers
in vue to trigger value change:
watch: {
'input.city': function(value) {
console.log('city changed');
}
}
More detail: https://v2.vuejs.org/v2/guide/computed.html#Watchers
π€Cong Nguyen
0π
I do not know if you used vue2-selectize, if yes, you can try code below, as this vue component emits an input event while changing selection:
<selectize v-model="input.city" data-placeholder="City" required @input="test">
<option :value="data.id" v-for="(d, i) in cities" :key="i"> {{d.name}} </option>
</selectize>
π€wang eason
0π
@input
works for me.
<selectize data-placeholder="City" required @input="test">
<option :value="data.id" v-for="(d, i) in cities" :key="i"> {{d.name}} </option>
</selectize>
test(value){
this.input.city = value;
alert("it's work");
}
π€Eugene P.
Source:stackexchange.com