Listeners declared in emits array are inacessible
Version
3.2.19
Reproduction link
Steps to reproduce
Uncomment the emits array declaration in VirtualForm component
What is expected?
Refering to the documentation: https://v3.vuejs.org/guide/migration/listeners-removed.html, the listeners should be available as keys of the this.$attrs object
What is actually happening?
The listeners are not available.
Thanks for quick response.
My point is that all undeclared properties are available in the $attrs
. As soon as the property is declared it is available somwhere else, but with the listeners declaration (including in emits) makes a listener "unaccessible". So what is the solution here? Should I simply exclude listener from emits
if I want to acess it somewhere in the code? Is it "safe"? - because vue emits the warning.
In order to check if it exists, you should declare it as a prop: https://github.com/vuejs/rfcs/pull/154#issuecomment-614724480