Skip to content

Prop type conversion fails on Custom Element with camelCase prop name #5374

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

Closed
crackalak opened this issue Feb 8, 2022 · 0 comments · Fixed by #5377
Closed

Prop type conversion fails on Custom Element with camelCase prop name #5374

crackalak opened this issue Feb 8, 2022 · 0 comments · Fixed by #5377
Assignees
Labels
🐞 bug Something isn't working scope: custom elements

Comments

@crackalak
Copy link

Version

3.2.30

Reproduction link

stackblitz.com

Steps to reproduce

Click the button to increment the page number

What is expected?

No type check warnings should appear in the console

What is actually happening?

[Vue warn]: Invalid prop: type check failed for prop "pageNumber". Expected Number with value 1, got String with value "1".


I think the key chould be camelized before checking _numberProps here:

protected _setAttr(key: string) {
let value = this.getAttribute(key)
if (this._numberProps && this._numberProps[key]) {
value = toNumber(value)
}
this._setProp(camelize(key), value, false)
}

@LinusBorg LinusBorg added scope: custom elements 🐞 bug Something isn't working labels Feb 8, 2022
@LinusBorg LinusBorg self-assigned this Feb 8, 2022
chrislone pushed a commit to chrislone/core that referenced this issue Feb 4, 2023
zhangzhonghe pushed a commit to zhangzhonghe/core that referenced this issue Apr 12, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
BridgeAR Ruben Bridgewater
… props. (fix: vuejs#5374) (vuejs#5377)
@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working scope: custom elements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants