-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Closed
Labels
🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope: custom elements
Description
Vue version
3.5.13
Link to minimal reproduction
Steps to reproduce
- Observe the initial render result in preview, we can see for number value and boolean
true
, they are actuall strings
- click toggle for several times, we can see later results are correct
What is expected?
value type should be as it is
What is actually happening?
I know if I use type: Number
for props, vue will transform them into number, but if it's a mixed types(or no type definition) like below, vue will not do the transform, that is useful if we want to use the props as they actually are
props: {
value: {},
},
props: {
value: {
type: [Number, String, Boolean],
}
},
In initial render, primitive values are reflected into attributes because of below code
this._resolveProps(this._def)
this._setProp(key, val, true, true)
that happens in constructor, but later in _resolveDef
, attributes are used again in this._setAttr
and then cause this issue
System Info
Any additional comments?
No response
Metadata
Metadata
Assignees
Labels
🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope: custom elements