Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue emits "Extraneous non-emits event listeners" warning for events on RouterView #1735

Closed
jez9999 opened this issue Mar 13, 2023 · 2 comments

Comments

@jez9999
Copy link

jez9999 commented Mar 13, 2023

Reproduction

https://stackblitz.com/edit/vitejs-vite-jy1j3d

Steps to reproduce the bug

Listen for an event on router-view which is emitted by a child component. Vue will display a warning about "Extraneous non-emits event listeners" even though a child component emits the event, if the initial path loaded renders a child component that doesn't emit the event.

Expected behavior

Vue detects that one of the child components that may be rendered by the router view emits the event, and doesn't give the warning.

Actual behavior

Vue gives the warning.

Additional information

No response

@posva posva closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2023
Copy link
Member

posva commented Mar 13, 2023

This is not related to the router: the Home component doesn't declare that emit, that's why you see the warning.

@jez9999
Copy link
Author

jez9999 commented Mar 13, 2023

@posva But why should the Home component need to? There needs to be a mechanism to allow any child component that may be rendered by a router-view to emit events through the router-view.

@vuejs vuejs locked and limited conversation to collaborators Mar 13, 2023
@posva posva converted this issue into discussion #1736 Mar 13, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants