Open
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