Vue · Junior · Question 9 of 75
What does @submit.prevent="onSubmit" do?
- ✓Correct answer: Calls
onSubmitand also callsevent.preventDefault(), so the page doesn't reload - 2Prevents
onSubmitfrom being called - 3Submits the form only once
Explanation
Event modifiers keep handlers focused on logic: .prevent, .stop, .once, .self, .capture, .passive. Key modifiers such as @keyup.enter filter keyboard events.