Subscribe on changes!

vue3 $emit('event') popup

avatar
Aug 9th 2022

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

avatar
Aug 9th 2022

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.

avatar
Aug 9th 2022

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

SFC Playground


Remember to use the forum or the Discord chat to ask questions!