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
Currently, to define a Vue component with typed slots, you can't use DefineComponent as the slots are manually set to Readonly<InternalSlots>.
A hacky workaround is to use a generator function that returns defineComponent(...).
The return type of this generator function is a constructor type which tries to emulate DefineComponent:
What problem does this feature solve?
Currently, to define a Vue component with typed slots, you can't use
DefineComponent
as the slots are manually set toReadonly<InternalSlots>
.A hacky workaround is to use a generator function that returns
defineComponent(...)
.The return type of this generator function is a constructor type which tries to emulate
DefineComponent
:What does the proposed API look like?
For manually setting the type:
In the future it would be awesome, if
Slots
would be infered out of the template / render function.Or a
defineSlots<...>()
macro could be provided instead, like withdefineProps<...>()
?The text was updated successfully, but these errors were encountered: