Sometimes, we want to fire an event when v-model changes with Vue.js.
In this article, we’ll look at how to fire an event when v-model changes with Vue.js.
How to fire an event when v-model changes with Vue.js?
To fire an event when v-model changes with Vue.js, we an listen for the change
event.
For instance, we write
<template>
<input
type="radio"
name="optionsRadios"
id="optionsRadios2"
value=""
v-model="srStatus"
@change="foo"
/>
</template>
to listen for the change event with @change
.
If the event is emitted, then we run the foo
method.
Conclusion
To fire an event when v-model changes with Vue.js, we an listen for the change
event.