-
-
Notifications
You must be signed in to change notification settings - Fork 469
Labels
Description
Vue - Official extension or vue-tsc version
2.2.6
VSCode version
1.97.2
Vue version
3.5.13
TypeScript version
5.7.3
System Info
package.json dependencies
Steps to reproduce
Create a SFC with a v-model that accepts different types, such as:
const model = defineModel<string | number>({
required: true,
});
Then use the component:
const testValue = ref("Hello, World")
<MyComponent v-model="testValue" />
What is expected?
Given the following is valid TS:
let test:string | number = "test"
test = 8;
There should be no TypeScript errors.
What is actually happening?
The following error is being displayed in VSCode:
Type 'string | number' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'. ts-plugin(2322)
Link to minimal reproduction
https://github.com/richmason/vue-ts-issue
Any additional comments?
This was not an issue in version 2.2.4
wister, Yizack, wiidede, redcats002 and planetdaz