@@ -263,13 +263,13 @@ export function generate(
263
263
codeGen . push ( `>` ) ;
264
264
}
265
265
codeGen . push ( '(' ) ;
266
- if ( scriptSetupRanges . propsTypeArg ) {
266
+ if ( vueCompilerOptions . experimentalRfc436 && scriptSetupRanges . propsTypeArg ) {
267
267
codeGen . push ( '__VLS_props: ' ) ;
268
268
addVirtualCode ( 'scriptSetup' , scriptSetupRanges . propsTypeArg . start , scriptSetupRanges . propsTypeArg . end ) ;
269
269
}
270
270
codeGen . push ( ') => {\n' ) ;
271
271
codeGen . push ( 'const __VLS_setup = async () => {\n' ) ;
272
- if ( scriptSetupRanges . propsTypeArg ) {
272
+ if ( vueCompilerOptions . experimentalRfc436 && scriptSetupRanges . propsTypeArg ) {
273
273
addVirtualCode ( 'scriptSetup' , scriptSetupRanges . importSectionEndOffset , scriptSetupRanges . propsTypeArg . start ) ;
274
274
codeGen . push ( 'typeof __VLS_props' ) ;
275
275
addVirtualCode ( 'scriptSetup' , scriptSetupRanges . propsTypeArg . end ) ;
@@ -308,7 +308,14 @@ export function generate(
308
308
codeGen . push ( `__VLS_WithDefaults<` ) ;
309
309
}
310
310
311
- codeGen . push ( `__VLS_TypePropsToRuntimeProps<typeof __VLS_props>` ) ;
311
+ codeGen . push ( `__VLS_TypePropsToRuntimeProps<` ) ;
312
+ if ( vueCompilerOptions . experimentalRfc436 ) {
313
+ codeGen . push ( `typeof __VLS_props` ) ;
314
+ }
315
+ else {
316
+ addExtraReferenceVirtualCode ( 'scriptSetup' , scriptSetupRanges . propsTypeArg . start , scriptSetupRanges . propsTypeArg . end ) ;
317
+ }
318
+ codeGen . push ( `>` ) ;
312
319
313
320
if ( scriptSetupRanges . withDefaultsArg ) {
314
321
codeGen . push ( `, typeof __VLS_withDefaultsArg` ) ;
0 commit comments