Skip to content

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

@crackalak

Description

@crackalak

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)
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions