Capturing Events
Explore how event propagation works in VueJS, including bubbling and capturing phases, and learn to use event modifiers to control event flow. Understand how to stop event propagation and apply these concepts to both native and custom events for better application behavior.
We'll cover the following...
Event propagation is a central feature of modern-day JavaScript. At its core, event propagation helps us add general behavior to groups of DOM elements while still adding specific behavior to components that need it.
Vue lets us control event propagation with the help of event modifiers in the same way that we can control event propagation in Vanilla JS event listeners. Vue’s advantage is readability through minimal syntax and a central way of doing things.
Event propagation
What exactly is event propagation, though? Events can either bubble up or trickle down. The default state of an event is to bubble up to ...