vue3 $emit('event') popup
Vue version
vue3
Link to minimal reproduction
https://codesandbox.io/s/romantic-shannon-0qnp0t?file=/src/components/HelloWordInner.vue
Steps to reproduce
open link --> click button
What is expected?
do not log 'app,func' on console
What is actually happening?
log 'app,func' on console
System Info
No response
Any additional comments?
No response
I experience the same issue in my app, even though the documentation clearly states that component emitted events do not bubble: https://vuejs.org/guide/components/events.html#emitting-and-listening-to-events.
Looks like a bug.
This is intended behavior because by default the emits get inherited by the child. You should either remove the @fun
in App.vue or add inheritAttrs: false
to HelloWorld.vue
Remember to use the forum or the Discord chat to ask questions!