File tree 2 files changed +13
-14
lines changed
language-core/lib/codegen/template
2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -129,8 +129,13 @@ export function createTemplateCodegenContext(options: Pick<TemplateCodegenOption
129
129
} ,
130
130
generateHoistVariables : function * ( ) {
131
131
// trick to avoid TS 4081 (#5186)
132
- for ( const [ originalVar , hoistVar ] of hoistVars ) {
133
- yield `var ${ hoistVar } = ${ originalVar } ${ endOfLine } ` ;
132
+ if ( hoistVars . size ) {
133
+ yield `// @ts-ignore${ newLine } ` ;
134
+ yield `var `
135
+ for ( const [ originalVar , hoistVar ] of hoistVars ) {
136
+ yield `${ hoistVar } = ${ originalVar } , ` ;
137
+ }
138
+ yield endOfLine ;
134
139
}
135
140
} ,
136
141
ignoreError : function * ( ) : Generator < Code > {
Original file line number Diff line number Diff line change @@ -587,14 +587,11 @@ export {};
587
587
588
588
exports[`vue-tsc-dts > Input: template-slots/component.vue, Output: template-slots/component.vue.d.ts 1`] = `
589
589
"declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => { } >>;
590
- declare var __VLS_1: { } ;
591
- declare var __VLS_3: {
590
+ declare var __VLS_1: { } , __VLS_3: {
592
591
num : number ;
593
- } ;
594
- declare var __VLS_5: {
592
+ } , __VLS_5: {
595
593
str : string ;
596
- } ;
597
- declare var __VLS_7: {
594
+ } , __VLS_7: {
598
595
num : number ;
599
596
str : string ;
600
597
} ;
@@ -664,14 +661,11 @@ type __VLS_WithSlots<T, S> = T & {
664
661
665
662
exports[`vue-tsc-dts > Input: template-slots/component-no-script.vue, Output: template-slots/component-no-script.vue.d.ts 1`] = `
666
663
"declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => { } >>;
667
- declare var __VLS_1: { } ;
668
- declare var __VLS_3: {
664
+ declare var __VLS_1: { } , __VLS_3: {
669
665
num : number ;
670
- } ;
671
- declare var __VLS_5: {
666
+ } , __VLS_5: {
672
667
str : string ;
673
- } ;
674
- declare var __VLS_7: {
668
+ } , __VLS_7: {
675
669
num : number ;
676
670
str : string ;
677
671
} ;
You can’t perform that action at this time.
0 commit comments