-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
defineModel
coerces string to boolean in production build when string | boolean
union is used
#10676
Labels
Comments
const value = defineModel<boolean | string>({ required: true }); |
Thanks! I now see that if I change order from |
Closed
6 tasks
wangdaoo
pushed a commit
to wangdaoo/core
that referenced
this issue
May 30, 2024
…n types (vuejs#9603) close vuejs#9587 close vuejs#10676
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Vue version
3.4.21
Link to minimal reproduction
https://play.vuejs.org/#eNqFkslu3DAMhl+F1cUJMLbR5TRwBuiSQwu0CdKiJwG1Y9MTpbKkanGncP3uoWzPZBBkuVH8uXwiObD3xmR9QLZmhautMB4c+mBAVmp7xpl3nG24Ep3R1sMAFlsYobW6g4TSkoP0UXdm8Wd5fMSqJHNVa+U89HAWk0+S5BTyHJy3Qm2jh6sinztTH3p47IysPNILoJjK9mmnG5SE03MGOSlFfhTGVoRJXVqxzW6dVvSXISZzVlO2kGgvjBdEwdkaJiVqlZT675fJ523A1d5f32D9+xH/rdtFH2eXFh3aHjk7aL6yW/SzfP79G+7IPojEHiRFPyNeodMyRMY57ENQDWEfxU20n6dR09x+uPOdR+X2n4qgMXKc4mlMAePgnvr6Pe7b7N2Ux9VIU9yv7YVjWBZayYC01AZbofBrXFCxbPU/XGstsVKbk3gxf4Kw2MyUMJ4+v/BG9JNB5qs0hdkESJd+PljlQCivoYz1SrKhvLy6+FRCPJL7eIudphzQLZQHoHI+0fIIukwc+H8GV9CKHZJ9g2CsvpbYzcXSdAH6GQnWUBiLm2FYgMaxyKNjgs9n+ofX+atHG3dFc6WBZ29es/EO0+omHA==
Steps to reproduce
Make sure to first click on
Comp.vue
tab to render it first (dunno why this is needed, but it is).Click on
Dev
to flip it toProd
in the top nav and seeValue:
turns toValue: true
.What is expected?
Dev and prod mode should work the same, keeping model value a string.
In other words, type annotation shouldn't coerce model's value.
What is actually happening?
Model turns to boolean in prod mode.
System Info
No response
Any additional comments?
Sorry if this has been reported, I couldn't easily find an issue if it was.
The text was updated successfully, but these errors were encountered: