Detect if parent component is listening to a specific event with `@my-event`
What problem does this feature solve?
I have a component that is dismissable and I just want to show the X [close] button if there is a function assigned to the component. attrs['onDismiss'] is undifined when I try to access it one I specify emits: ['dismiss'] if I remove the emits then it works and as far as I understand the emits its best practice. I dont want to introduce anoter property since the @dismiss is there and I just want to know if it is assigned.
What does the proposed API look like?
attrs['event'] should return true or false if assigned.
You can declare a prop named onEvent
to detect an attached event @event
on props.onEvent
(example)