Skip to content

Commit 426f8d5

Browse files
authored
fix(language-core): fix syntax error when propTypes has no elements (#5704)
1 parent 8697068 commit 426f8d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/language-core/lib/codegen/script/scriptSetup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function* generateScriptSetup(
8989
}
9090

9191
yield `return {} as {${newLine}`
92-
+ ` props: ${ctx.localTypes.PrettifyLocal}<${propTypes.join(` & `)}> & ${
92+
+ ` props: ${propTypes.length ? `${ctx.localTypes.PrettifyLocal}<${propTypes.join(` & `)}> & ` : ``}${
9393
options.vueCompilerOptions.target >= 3.4
9494
? `import('${options.vueCompilerOptions.lib}').PublicProps`
9595
: options.vueCompilerOptions.target >= 3

0 commit comments

Comments
 (0)