-
-
Notifications
You must be signed in to change notification settings - Fork 501
Closed
Labels
Description
The following checkbox in my Vue 3 project
<input
v-model="closed"
true-value="-1"
false-value="0"
type="checkbox"
@change="UpdateFilter()"
/>
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:
//package.json
"devDependencies": {
"@vitejs/plugin-vue": "^2.3.1",
"typescript": "^4.5.4",
"vite": "^2.9.5",
"vue-tsc": "^0.34.7"
}