New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSX compatible slots #2472
Closed
Labels
enhancement
New feature or request
Comments
Adding |
5 tasks
5 tasks
johnsoncodehk
added a commit
that referenced
this issue
Mar 26, 2023
4 tasks
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: