How to fire an event when v-model changes?

后端 未结 5 2137
滥情空心
滥情空心 2020-12-13 02:03

I\'m trying to fire the foo() function with the @click but as you can see, need press the radio button two times to fire the event correctly . Only

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 02:32

    You should use @input:

    
    

    @input fires when user changes input value.

    @change fires when user changed value and unfocus input (for example clicked somewhere outside)

    You can see the difference here: https://jsfiddle.net/posva/oqe9e8pb/

提交回复
热议问题