Imagine a wrapper component where you need to pass events to a child component. This is possible for non native events using this.$listeners, but it strips out native events. It would be good if we had something like this.$nativeListeners so that we can pass native events down to child components as well.
In the meantime, Is there a workaround to pass events to child components?
this.$nativeListeners
Maybe something like inheritNativeListeners: true (that default to false) to go in pair with inheritAttrs
Native listeners are available in functional components but are passed to the root of the component in regular components
Thanks for the reply! Is there a workaround to get the native events out of the root?
not that i'm aware of
@DM2489
Is there a workaround to get the native events out of the root
You can access them in this.$vnode.data.nativeOn
Note they will still be bound to the root element though and that you should avoid reading $vnode in general and never modify it
Most helpful comment
Note they will still be bound to the root element though and that you should avoid reading
$vnodein general and never modify it