Add docs addressing "$attrs no longer contains events declared in the emits option" issue#3055
Add docs addressing "$attrs no longer contains events declared in the emits option" issue#3055stevebauman wants to merge 2 commits intovuejs:mainfrom
Conversation
✅ Deploy Preview for vuejs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
If we want to add this part of the documentation, let's start with why do we want/need to check on the event. Otherwise the use-case is not clear (I know there are examples in the thread, but we need some "you might find yourself in a need to check for a listener bound). |
|
@NataliaTepluhina Ok sounds good! Would you be able to share an example of the style you may be looking for from an existing doc page so I can write it in the format that you may be expecting? 🙏 The existing docs on this API page don't share any "why"'s, only "how"'s... |
|
@stevebauman a good example can be a beginning of the Forms section in the Guide: https://vuejs.org/guide/essentials/forms.html - we show first how we could do it with our "known" tools and then introduce |
|
Ok thanks @NataliaTepluhina! Marking as draft and will update this a few hours (away from computer atm) and will mark ready once good to go for re-review. |
Description of Problem
There is a long-standing discussion from 2021 with comments as recent as September 6th on the disappearance of event listeners in
$attrswhen those events are declared in theemitsproperty:vuejs/rfcs#397
This is documented here, but with no solution proposed:
https://vuejs.org/api/options-state.html#emits
Proposed Solution
Additional docs can be added for those who discover that this occurs so that developers can properly utilize this un-documented functionality in Vue (or, if the docs do exist, correct me if I'm wrong) that allows developers to create props for these event listeners that Vue will auto-populate if they conform to a specific naming convention.
Additional Information
N/A