Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9k
Open
Description
Vue version
3.5.25
Link to minimal reproduction
Steps to reproduce
- Define a prop with type: [Boolean, String, Number] (Boolean listed first)
- Set a default value of empty string: default: ''
- Pass an empty string value to the component:
- Check the received prop value in the component
What is expected?
When passing value="", the component should receive:
- this.value === "" (empty string)
- typeof this.value === "string"
What is actually happening?
When Boolean is the first type in the array, Vue incorrectly coerces the empty string "" to true:
- this.value === true
- typeof this.value === "boolean"
System Info
Any additional comments?
No response
Metadata
Metadata
Assignees
Labels
No labels