The method in Vue runs twice on click The method in Vue runs twice on click vue.js vue.js

The method in Vue runs twice on click


If you move @click="set(rating)" to <input/> instead of <label/>, it will run once.


@click.stop="clickfunction($event)"

This will stop next calls and will call function only once.


It is a default browser behavior. Clicking on the <label> will trigger 2 clicks, one for <label> and one for <input>.

Way to avoid that is to add @click.prevent to your <label> tag.