fix(compiler-core): detected forwarded slots in nested components (#4268)
fix #4244
This commit is contained in:
		
							parent
							
								
									a211e271ee
								
							
						
					
					
						commit
						abb3a81e87
					
				@ -778,6 +778,13 @@ describe('compiler: transform component slots', () => {
 | 
			
		||||
      )
 | 
			
		||||
      expect(slots).toMatchObject(toMatch)
 | 
			
		||||
    })
 | 
			
		||||
 | 
			
		||||
    test('<slot w/ nested component>', () => {
 | 
			
		||||
      const { slots } = parseWithSlots(
 | 
			
		||||
        `<Comp><Comp><slot/></Comp></Comp>`
 | 
			
		||||
      )
 | 
			
		||||
      expect(slots).toMatchObject(toMatch)
 | 
			
		||||
    })
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
  describe('errors', () => {
 | 
			
		||||
 | 
			
		||||
@ -384,9 +384,7 @@ function hasForwardedSlots(children: TemplateChildNode[]): boolean {
 | 
			
		||||
      case NodeTypes.ELEMENT:
 | 
			
		||||
        if (
 | 
			
		||||
          child.tagType === ElementTypes.SLOT ||
 | 
			
		||||
          ((child.tagType === ElementTypes.ELEMENT ||
 | 
			
		||||
            child.tagType === ElementTypes.TEMPLATE) &&
 | 
			
		||||
            hasForwardedSlots(child.children))
 | 
			
		||||
          hasForwardedSlots(child.children)
 | 
			
		||||
        ) {
 | 
			
		||||
          return true
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user