Open RayGuo-ergou opened 2 months ago
Type union is okay
Interface extends is not
Found another issue, if params passed into defineModel
, the params type of emits will be unknown []
Could the fix #4823 solve this?
Potentially yes, I will report back once it's merged and released.
FYI @KazariEX #4823 does not fix this.
The prop and event names generated by defineModel
are determined only by the first parameter, passing checked
will result in duplication with the update:checked
event that comes with the component library.
But I did not pass 'checked' to defineModel
's name 🤔
https://github.com/RayGuo-ergou/volar-reproduction/blob/main/src/components/Checkbox.vue#L23
const checked = defineModel<boolean>();
or I misunderstood?
Vue - Official extension or vue-tsc version
2.1.6
VSCode version
none
Vue version
3.5.3
TypeScript version
5.5.4
System Info
package.json dependencies
No response
Steps to reproduce
To reproduce, these requirement has to meet
Then the component inside
template
will have type ofunknown
.Should be able to reproduce with the repo provided below. Here's some screenshots
What is expected?
Having correct type for components.
What is actually happening?
Infer as
unknown
Link to minimal reproduction
https://github.com/RayGuo-ergou/volar-reproduction
Any additional comments?
possible related to https://github.com/vuejs/language-tools/issues/4822 ?
Also the current
radix-vue
is built with2.0.x
so this might caused this issue?