Vue · Junior · Question 51 of 75
What do the .stop and .once event modifiers do?
<button @click.stop="select">Select</button>
<button @click.once="subscribe">Subscribe</button>- ✓Correct answer:
.stopcallsevent.stopPropagation();.onceruns the handler only the first time - 2
.stopdisables the button;.oncedebounces clicks - 3Both prevent the default browser action
Explanation
Modifiers keep handlers focused on logic instead of DOM details. Others include .prevent, .self, .capture and .passive.