question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Equivalent for this.$listeners for native events?

See original GitHub issue

What problem does this feature solve?

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?

What does the proposed API look like?

this.$nativeListeners

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
posvacommented, Mar 22, 2019

Note they will still be bound to the root element though and that you should avoid reading $vnode in general and never modify it

1reaction
sqalcommented, Mar 22, 2019

@DM2489

Is there a workaround to get the native events out of the root

You can access them in this.$vnode.data.nativeOn

Read more comments on GitHub >

github_iconTop Results From Across the Web

$listeners removed - Vue 3 Migration Guide
In Vue 3's virtual DOM, event listeners are now just attributes, prefixed with on , and as such are part of the $attrs...
Read more >
QUICK VUE TIP - EVENT LISTENERS WITH THIS.$LISTENERS
In this video we look at Vue.js and create event listeners using this.$ listeners ! Watch all the way to the end to...
Read more >
Event Listeners in React Components - Pluralsight
Listening to events in a vanilla Javascript app might be something you are familiar with. Doing the same event listening in a React...
Read more >
Does Java have native support for events, similar to that of C ...
And no, Java does not have native support for events, like C# does with delegates. ... The source and listener have to be...
Read more >
Working with App State and Event Listeners in React Native
With a high level understanding of AppState , let's now examine how to overcome the limitation of event listeners, that only read component ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found