File tree Expand file tree Collapse file tree 5 files changed +23
-4
lines changed 
packages/language-core/lib/codegen/template 
test-workspace/tsc/passedFixtures Expand file tree Collapse file tree 5 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,11 @@ export function createTemplateCodegenContext(options: Pick<TemplateCodegenOption
242242				yield  endOfLine ; 
243243			} 
244244		} , 
245+ 		generateConditionGuards : function *  ( )  { 
246+ 			for  ( const  condition  of  blockConditions )  { 
247+ 				yield  `if (!${ condition } ${ endOfLine }  ; 
248+ 			} 
249+ 		} , 
245250		ignoreError : function *  ( ) : Generator < Code >  { 
246251			if  ( ! ignoredError )  { 
247252				ignoredError  =  true ; 
Original file line number Diff line number Diff line change @@ -109,12 +109,9 @@ export function* generateEventExpression(
109109		if  ( _isCompoundExpression )  { 
110110			yield  `(...[$event]) => {${ newLine }  ; 
111111			ctx . addLocalVariable ( '$event' ) ; 
112- 
112+ 			 yield *   ctx . generateConditionGuards ( ) ; 
113113			prefix  =  `` ; 
114114			suffix  =  `` ; 
115- 			for  ( const  blockCondition  of  ctx . blockConditions )  { 
116- 				prefix  +=  `if (!${ blockCondition } ${ endOfLine }  ; 
117- 			} 
118115		} 
119116
120117		yield *  generateInterpolation ( 
Original file line number Diff line number Diff line change 2929		" ../vue3/#4822" 
3030		" ../vue3/#4826" 
3131		" ../vue3/#4828" 
32+ 		" ../vue3/#5225" 
3233		" ../vue3/attrs" 
3334		" ../vue3/components" 
3435		" ../vue3/defineEmits" 
Original file line number Diff line number Diff line change 1+ <script  setup lang="ts">
2+ defineModel <number >({ required: true  });
3+ script >
Original file line number Diff line number Diff line change 1+ <script  setup lang="ts">
2+ import  Comp  from  ' ./comp.vue' 
3+ 
4+ let  foo! :  {
5+     bar? :  number ; 
6+ }; 
7+ script >
8+ 
9+ <template >
10+     <!--  @vue-expect-error --> 
11+     <Comp  v-model =" foo.bar" 
12+     <Comp  v-if =" foo.bar" v-model =" foo.bar" 
13+ </template >
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments