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

VNode prop keys are not normalized #1755

Closed
yusufkandemir opened this issue Aug 1, 2020 · 1 comment
Closed

VNode prop keys are not normalized #1755

yusufkandemir opened this issue Aug 1, 2020 · 1 comment

Comments

@yusufkandemir
Copy link

yusufkandemir commented Aug 1, 2020

Version

3.0.0-rc.5

Reproduction link

https://codepen.io/yusufkandemir/pen/abdeYVN?editors=0010

Steps to reproduce

Just run the reproduction.

What is expected?

slot.props(slot is a VNode basically) to contain normalized(naming-wise) prop key and value pairs.

What is actually happening?

It's handled correctly while rendering but it's not the case with direct access. The prop key stays the same as how it was passed initially.


I have changed panel.componentOptions.propsData.imgSrc to panel.props.imgSrc (panel is a child in the default slot) while migrating to Vue 3. I have spotted that it was not working correctly. After doing some tests and debugging, I saw that it's either panel.props.imgSrc or panel.props['img-src']. After further work, I created a reproduction and this issue.

@yyx990803
Copy link
Member

VNode props are never guaranteed to be normalized, this is not documented behavior. The normalization happens only when the component is receiving the props.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 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

2 participants