Skip to content
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

Extraneous non-emits event listeners (addTask) were passed to component #7

Open
lulu-cao opened this issue Nov 6, 2022 · 0 comments

Comments

@lulu-cao
Copy link

lulu-cao commented Nov 6, 2022

Thanks for the tutorial. It's great!

I followed along but still got this warning in the console every time I clicked on the "Add a Task" button:
Extraneous non-emits event listeners (addTask) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.
at <AddTask onAddTask=fn<bound addTask> >
at <App showAddTask=true onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< Proxy {deleteTask: ƒ, addTask: ƒ, toggleStatus: ƒ, …} > >
at <RouterView showAddTask=true >
at <App>

I found out that declaring the emitted event works in removing the warning. Hope this helps.

  • Add emits: ['add-task'] to the export in /src/components/AddTask.vue
@lulu-cao lulu-cao changed the title Extraneous non-emits event listeners (addPost) were passed to component Extraneous non-emits event listeners (addTask) were passed to component Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant