Closed Mik-pe closed 1 month ago
What does your tsconfig.json
look like?
What does your
tsconfig.json
look like?
I noticed that my tsconfig.json
referenced an older vueCompilerOptions
"vueCompilerOptions": {
"target": 2.7
},
Changing this to "auto" or 3.5 makes this function as intended, thanks!
Vue - Official extension or vue-tsc version
2.1.6
VSCode version
Version: 1.94.1 Commit: e10f2369d0d9614a452462f2e01cdc4aa9486296 Date: 2024-10-05T05:44:32.189Z Electron: 30.5.1 ElectronBuildId: 10262041 Chromium: 124.0.6367.243 Node.js: 20.16.0 V8: 12.4.254.20-electron.0 OS: Linux x64 6.8.0-1011-oem
Vue version
3.5.11
TypeScript version
5.6.2
System Info
package.json dependencies
No response
Steps to reproduce
Defining a
BaseFoo
component as:and using it through my
BaseFooTest
parent:What is expected?
The type for
v-model
inBaseFooTest
can be bound without type errorsWhat is actually happening?
There are type errors in
BaseFooTest
Removing the {required: true} in
BaseFoo
makes the error go away, using only:const modelValue = defineModel();
Link to minimal reproduction
No response
Any additional comments?
I found that setting a v-model name:
const modelValue = defineModel('value', {required:true});
also hides the error