File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
packages/language-core/lib/generators
test-workspace/tsc/vue3/#4050 Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -872,12 +872,14 @@ type __VLS_PrettifyGlobal<T> = { [K in keyof T]: T[K]; } & {};
872
872
}
873
873
yield _ ( `},\n` ) ;
874
874
}
875
- yield _ ( `emits: ({} as __VLS_NormalizeEmits<typeof __VLS_modelEmitsType` ) ;
876
- if ( ranges . emits . define ) {
877
- yield _ ( ` & typeof ` ) ;
878
- yield _ ( ranges . emits . name ?? '__VLS_emit' ) ;
875
+ if ( ranges . defineProp . filter ( p => p . isModel ) . length || ranges . emits . define ) {
876
+ yield _ ( `emits: ({} as __VLS_NormalizeEmits<typeof __VLS_modelEmitsType` ) ;
877
+ if ( ranges . emits . define ) {
878
+ yield _ ( ` & typeof ` ) ;
879
+ yield _ ( ranges . emits . name ?? '__VLS_emit' ) ;
880
+ }
881
+ yield _ ( `>),\n` ) ;
879
882
}
880
- yield _ ( `>),\n` ) ;
881
883
}
882
884
if ( script && scriptRanges ?. exportDefault ?. args ) {
883
885
yield _ ( generateSourceCode ( script , scriptRanges . exportDefault . args . start + 1 , scriptRanges . exportDefault . args . end - 1 ) ) ;
Original file line number Diff line number Diff line change
1
+ <script setup lang="ts"></script >
2
+
3
+ <script lang="ts">
4
+ import { defineComponent } from ' vue' ;
5
+
6
+ export default defineComponent ({
7
+ emits: [' hasFart' ],
8
+ });
9
+ </script >
You can’t perform that action at this time.
0 commit comments