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
vue-tsc bug with checkboxes and numbers #1252
Comments
This is correct error, you should change |
But aren't this "attributes" (true-value, false-value) a vue feature designed to allow different input types (like strings "true"/"false") as stated here: |
Yes string |
I understand. Thanks for the clarification. |
@johnsoncodehk vue doesn't set |
@KaelWD You are pointing out vue runtime behavior, but this is vue types behavior problem, it should still handle in vue but not volar (just what I said at #1252 (comment)). |
You can't just change |
I actually asked for a feature change in vue - or actually I started a "discussion". Since I have many checkboxes in my application I decided to go for a simpler way. |
Thanks for the explanation, I don't fully understand it yet, will look at it later. |
After v1.0.7 you can use |
The following checkbox in my Vue 3 project
creates the typescript error:
“Type ‘number’ is not assignable to type ‘any[] | Booleanish | undefined’.ts(2322)”
The variable “closed” is a number indeed. And I told vue to handle -1 as true and 0 as false, but vue-tsc doesn’t seem to recognize this.
My dev dependencies look like this:
The text was updated successfully, but these errors were encountered: