Skip to content
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

kebab-case dynamic props disappear #955

Closed
jods4 opened this issue Apr 12, 2020 · 0 comments
Closed

kebab-case dynamic props disappear #955

jods4 opened this issue Apr 12, 2020 · 0 comments

Comments

@jods4
Copy link
Contributor

jods4 commented Apr 12, 2020

Version

3.0.0-alpha.12

Steps to reproduce

Sorry I couldn't reproduce the behavior of my app in a repro so I had to debug it myself to figure out what's going on.

What I'm seeing is that sometimes Vue totally removes from props a kebab-case prop, although exactly the same template in camelCase works perfectly.

I traced it down to this code block:
https://github.com/vuejs/vue-next/blob/cb504c287f9517a055236cadfafcc64895c8825c/packages/runtime-core/src/componentProps.ts#L180-L184

My understanding of that code is: when a component has dynamic props, Vue removes from the props object any key that doesn't exist anymore in the new props.
The problem here is that rawCurrentProps is normalized (camel-case) but rawProps has the kebab-case key. So they don't match so my prop is erased.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant