File tree Expand file tree Collapse file tree 3 files changed +4
-12
lines changed
packages/language-core/lib/codegen/script
test-workspace/tsc/passedFixtures/vue3/#3779 Expand file tree Collapse file tree 3 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -77,16 +77,8 @@ function* generateTemplateCtx(
7777 exps . push ( [ `{} as { $emit: ${ emitTypes . join ( ` & ` ) } }` ] ) ;
7878 }
7979
80- const { defineProps, withDefaults } = scriptSetupRanges ?? { } ;
81- const props = defineProps ?. arg
82- ? `typeof ${ defineProps . name ?? names . props } `
83- : defineProps ?. typeArg
84- ? withDefaults ?. arg
85- ? `__VLS_WithDefaultsGlobal<${ names . Props } , typeof ${ names . defaults } >`
86- : `${ names . Props } `
87- : undefined ;
88- if ( props ) {
89- propTypes . push ( props ) ;
80+ if ( scriptSetupRanges ?. defineProps ) {
81+ propTypes . push ( `typeof ${ scriptSetupRanges . defineProps . name ?? names . props } ` ) ;
9082 }
9183 if ( scriptSetupRanges ?. defineModel . length ) {
9284 propTypes . push ( names . ModelProps ) ;
Original file line number Diff line number Diff line change @@ -6,5 +6,5 @@ defineProps<{
66 </script >
77
88<template >
9- <h1 >{{ exactType(optionalBoolean, {} as boolean | undefined ) }}</h1 >
9+ <h1 >{{ exactType(optionalBoolean, {} as boolean) }}</h1 >
1010</template >
Original file line number Diff line number Diff line change @@ -6,5 +6,5 @@ defineProps<{
66 </script >
77
88<template >
9- <h1 >{{ exactType(optionalBoolean, {} as boolean | undefined ) }}</h1 >
9+ <h1 >{{ exactType(optionalBoolean, {} as boolean) }}</h1 >
1010</template >
You can’t perform that action at this time.
0 commit comments