Let's say I have 3 components in a parent-child relationship.
Component1
is a parent of Component2
and Component2
is a parent of Component3
.
Component3
emits an event1
. Typically, event1
is handled in Component2
but in my particular case, I want to handle it in Component1
.
Backstory
The reason why I have set up my components this way, is because Component2
is a generic component whose content is Component3
. Tomorrow, I can create another Component4
and pass it to Component2
as a prop. Any event emitted from Component4
or Component3
needs to be accessed from an event handler in Component1
's template like
<template>
<component2 @event1="doSomething"></component2>
</template>