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
Vuetify defines slots as $props.$children and sets JSX.ElementChildrenAttribute to $children. Vue already comes with JSX.ElementAttributesProperty as $props so this works great in JSX:
Volar could check T[keyof JSX.ElementAttributesProperty][keyof JSX.ElementChildrenAttribute] to support any combination of these, and generate its own slots in $props somewhere so they can be used in JSX.
The text was updated successfully, but these errors were encountered:
Adding $props: { $slots } to our types seems to work for most components, but because volar is using T['$slots'] instead of T['$props']['$slots'] it doesn't pick up any slots for components with generic props like VSelect.
I swear this used to work ages ago.
Vuetify defines slots as
$props.$children
and setsJSX.ElementChildrenAttribute
to$children
. Vue already comes withJSX.ElementAttributesProperty
as$props
so this works great in JSX:Volar is only looking at
$slots
orchildren
though, so we'd have to define our slot types twice for them to work with it.language-tools/packages/vue-language-core/src/utils/localTypes.ts
Lines 61 to 65 in 97b01e6
This also means that slots from .vue files only work in other .vue files and can't be used in JSX:
vuejs/core#7083 adds ElementChildrenAttribute to vue core.
Volar could check
T[keyof JSX.ElementAttributesProperty][keyof JSX.ElementChildrenAttribute]
to support any combination of these, and generate its own slots in$props
somewhere so they can be used in JSX.The text was updated successfully, but these errors were encountered: