Closed robertmoura closed 2 months ago
2.1.4
1.92.2
3.5.0
5.5.4
System: OS: macOS 14.6.1 CPU: (8) arm64 Apple M1 Memory: 102.73 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.1.0 - /usr/local/bin/node Yarn: 4.4.0 - /usr/local/bin/yarn npm: 10.7.0 - /usr/local/bin/npm Browsers: Chrome: 128.0.6613.114 Edge: 128.0.2739.63 Safari: 17.6
No response
Create a Vue file with the following content:
<template> <div> {{ something }} </div> </template> <script lang="ts" setup> defineProps({ something: String, }); defineModel(); </script>
The type of something should be string | undefined.
something
string | undefined
I am getting the following error:
Property 'something' does not exist on type 'CreateComponentPublicInstanceWithMixins<Readonly<__VLS_PublicProps & { "onUpdate:modelValue"?: ((modelValue: any) => any) | undefined; }>, {}, {}, {}, {}, ComponentOptionsMixin, ... 18 more ..., {}>'. ts-plugin(2339)
This also happens when I run vue-tsc.
vue-tsc
It seems like there is a conflict between defineProps and defineModel.
defineProps
defineModel
Vue - Official extension or vue-tsc version
2.1.4
VSCode version
1.92.2
Vue version
3.5.0
TypeScript version
5.5.4
System Info
package.json dependencies
No response
Steps to reproduce
Create a Vue file with the following content:
What is expected?
The type of
something
should bestring | undefined
.What is actually happening?
I am getting the following error:
This also happens when I run
vue-tsc
.Link to minimal reproduction
No response
Any additional comments?
It seems like there is a conflict between
defineProps
anddefineModel
.