- Notifications
You must be signed in to change notification settings - Fork5k
Add docs addressing "$attrs no longer contains events declared in the emits option" issue#3055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
netlifybot commentedOct 9, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview forvuejs ready!
To edit notification comments on pull requests, go to yourNetlify site configuration. |
NataliaTepluhina commentedOct 14, 2024
If we want to add this part of the documentation, let's start withwhy 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). |
stevebauman commentedOct 14, 2024
@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... |
NataliaTepluhina commentedOct 29, 2024
@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 |
stevebauman commentedOct 29, 2024
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