-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning when emitting kebab-cased custom event #4803
Labels
Comments
This was referenced Oct 15, 2021
I tested your code outside of the SFC and there is no warning at all. Are you sure you were not using |
updated SFC sorry for the failing SFC earlier |
posva
added
🧹 p1-chore
Priority 1: this doesn't change code behavior.
🐞 bug
Something isn't working
and removed
need more info
Further information is requested
labels
Oct 18, 2021
14 tasks
15 tasks
I can reproduce this, but I see there is already a PR 🎉 |
This was referenced May 10, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Version
3.2.20
Reproduction link
sfc.vuejs.org
Steps to reproduce
Open SFC
What is expected?
no warning to be logged as component defined
onNewValue
propWhat is actually happening?
warning in console:
Having a component that emits a kebab-cased event (e.g.
new-value
as in Quasar'sQSelect
), you see the following warning:The component actually defines a prop named
onNewValue
- without listingnew-value
in the component'semits
property.It looks like this is due to the toHandlerKey helper only capitalizes the event name - which then only converts the first character to UPPERCASE.
Conventions done't allow non-camelized properties - so I think the
toHandlerKey
actually needs tocapitalize(camelize(str))
The text was updated successfully, but these errors were encountered: