Skip to content

Commit b7d8a5e

Browse files
committed
refactor(macros): add __isFragment flag
1 parent 0f85c1a commit b7d8a5e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/macros/src/volar/define-component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,13 @@ const __setup = `,
4343
? ['...', [compOptions.getText(ast), compOptions.getStart(ast)]]
4444
: []),
4545
`})
46-
type __Instance = {${isVapor ? '\n/** @deprecated This is only a type when used in Vapor Instances. */' : ''}
46+
type __Instance = (typeof __component extends new (...args: any) => any ? InstanceType<typeof __component> : typeof __component) & {${isVapor ? '\n/** @deprecated This is only a type when used in Vapor Instances. */' : ''}
4747
$props: __Props
48-
} & (typeof __component extends new (...args: any) => any ? InstanceType<typeof __component> : typeof __component)
48+
}
4949
return {} as {
50+
__isFragment?: never
51+
__isTeleport?: never
52+
__isSuspense?: never
5053
new (props: __Props): __Instance,
5154
setup: (props: __Props, ctx?: {
5255
attrs?: Record<string, any>

0 commit comments

Comments
 (0)