You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using typescript with vue's slot templates, there's a typescript error. The type of an object is specified in a slot template and typescript fails to recognize the specific type. Basically we have a child class which extends a main class which then I use the main class as the type definition inside defineSlots, but it doesn't recognize the slot type when using it in a template even though the child class is extending the main class.
The typing problem exists with defineSlots and not with defineProps.
Problem
When using typescript with vue's slot templates, there's a typescript error. The type of an object is specified in a slot template and typescript fails to recognize the specific type. Basically we have a child class which extends a main class which then I use the main class as the type definition inside defineSlots, but it doesn't recognize the slot type when using it in a template even though the child class is extending the main class.
The typing problem exists with
defineSlots
and not withdefineProps
.Reproduction
Check out this project to reproduce it by just running a
npm run type-check
:https://stackblitz.com/edit/vue-tsc-ts-slot-issue?file=src%2Fcomponents%2FReproProblem.vue
The VS Code IntelliSense displays this error too.
Expected
The typing should be recognized just like in
defineProps
.Dependency versions
vue-tsc
-2.0.13
typescript
-5.4.5
vue
-3.4.21
The text was updated successfully, but these errors were encountered: