@@ -32,20 +32,7 @@ export function* generateComponent(
3232 }
3333
3434 const returns : string [ ] [ ] = [ ] ;
35- const isJs = options . lang === 'js' || options . lang === 'jsx' ;
36- if ( isJs ) {
37- // fill $props
38- if ( scriptSetupRanges . defineProps ) {
39- const name = scriptSetupRanges . defineProps . name ?? names . props ;
40- // NOTE: defineProps is inaccurate for $props
41- returns . push ( [ name ] ) ;
42- returns . push ( [ `{} as { $props: Partial<typeof ${ name } > }` ] ) ;
43- }
44- // fill $emit
45- if ( scriptSetupRanges . defineEmits ) {
46- returns . push ( [ `{} as { $emit: typeof ${ scriptSetupRanges . defineEmits . name ?? names . emit } }` ] ) ;
47- }
48- }
35+
4936 if ( scriptSetupRanges . defineExpose ) {
5037 returns . push ( [ names . exposed ] ) ;
5138 }
@@ -55,11 +42,10 @@ export function* generateComponent(
5542 yield `),${ newLine } ` ;
5643 }
5744
58- if ( ! isJs ) {
59- const emitOptionCodes = [ ...generateEmitsOption ( options , scriptSetupRanges ) ] ;
60- yield * emitOptionCodes ;
61- yield * generatePropsOption ( options , ctx , scriptSetup , scriptSetupRanges , ! ! emitOptionCodes . length ) ;
62- }
45+ const emitOptionCodes = [ ...generateEmitsOption ( options , scriptSetupRanges ) ] ;
46+ yield * emitOptionCodes ;
47+ yield * generatePropsOption ( options , ctx , scriptSetup , scriptSetupRanges , ! ! emitOptionCodes . length ) ;
48+
6349 if (
6450 options . vueCompilerOptions . target >= 3.5
6551 && options . vueCompilerOptions . inferComponentDollarRefs
0 commit comments