Event listeners passed as attributes cause unexpected behaviour
Version
3.0.3
Reproduction link
https://codesandbox.io/s/elastic-christian-33req?file=/src/components/GrandChild.vue
Steps to reproduce
- Open https://codesandbox.io/s/elastic-christian-33req?file=/src/components/GrandChild.vue
- Observe double alert from App and Child components
What is expected?
Alert only from Child
What is actually happening?
Alert from App and Child
As I understood it is not a bug, more like a caveat, so it would be cool to have detailed explanation of what is happening in docs
You need inheritAttrs: false
in Child.vue
. This is documented: https://v3.vuejs.org/guide/component-attrs.html#attribute-inheritance
No, you have to either disable attribute inheritance or declare the emits
option https://v3.vuejs.org/guide/migration/emits-option.html