Skip to content

Commit

Permalink
reverse(jsx-directive): __VLS_getSlots
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyuanzmj committed Oct 24, 2023
1 parent d5b0d68 commit 2f3bf74
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/volar/src/jsx-directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,10 @@ function transformVSlot({
if (nodes.length === 0) return
codes.push(`type __VLS_getSlots<T> = T extends new () => { '${getSlotsPropertyName(
vueVersion || 3
)}': infer S } ? NonNullable<S> :
T extends (props: any, ctx: { slots: infer S }, ...args: any) => any ? NonNullable<S> :
{}`)
)}': infer S } ? NonNullable<S>
: T extends (props: any, ctx: infer Ctx extends { slots: any }) => any
? NonNullable<Ctx['slots']>
: {}`)

nodes.forEach((node) => {
if (!ts.isIdentifier(node.openingElement.tagName)) return
Expand Down

0 comments on commit 2f3bf74

Please sign in to comment.