close

How to fire an event when v-model changes?

Hello Guys, How are you all? Hope You all Are Fine. Today we are going to learn How to fire an event when v-model changes? in javascript. So Here I am Explain to you all the possible methods here.

Without wasting your time, Let’s start This Article.

How to fire an event when v-model changes ?

  1. How to fire an event when the v-model changes ?

    fire an event when v-model changes This happens because your click handler fires before the value of the radio button changes. You need to listen to the change event instead:

  2. fire an event when v-model changes

    fire an event when v-model changes This happens because your click handler fires before the value of the radio button changes. You need to listen to the change event instead:

Method 1

This happens because your click handler fires before the value of the radio button changes. You need to listen to the change event instead:

<input 
  type="radio" 
  name="optionsRadios" 
  id="optionsRadios2" 
  value=""
  v-model="srStatus" 
  v-on:change="foo"> //here

Also, make sure you really want to call foo() on ready… seems like maybe you don’t actually want to do that.

ready:function(){
    foo();
},

Method 2

Just to add to the correct answer above, in Vue.JS v1.0 you can write

<a v-on:click="doSomething">

So in this example it would be

 v-on:change="foo"

Summery

It’s all About this article. Hope all method helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which method worked for you? Thank You.

Leave a Comment