diff --git a/packages/compiler-core/__tests__/transforms/vSlot.spec.ts b/packages/compiler-core/__tests__/transforms/vSlot.spec.ts index beddd212a..bb26d6689 100644 --- a/packages/compiler-core/__tests__/transforms/vSlot.spec.ts +++ b/packages/compiler-core/__tests__/transforms/vSlot.spec.ts @@ -771,6 +771,13 @@ describe('compiler: transform component slots', () => { const { slots } = parseWithSlots(``) expect(slots).toMatchObject(toMatch) }) + + test(' tag w/ template', () => { + const { slots } = parseWithSlots( + `` + ) + expect(slots).toMatchObject(toMatch) + }) }) describe('errors', () => { diff --git a/packages/compiler-core/src/transforms/vSlot.ts b/packages/compiler-core/src/transforms/vSlot.ts index 327bac448..1e784c82b 100644 --- a/packages/compiler-core/src/transforms/vSlot.ts +++ b/packages/compiler-core/src/transforms/vSlot.ts @@ -384,7 +384,8 @@ function hasForwardedSlots(children: TemplateChildNode[]): boolean { case NodeTypes.ELEMENT: if ( child.tagType === ElementTypes.SLOT || - (child.tagType === ElementTypes.ELEMENT && + ((child.tagType === ElementTypes.ELEMENT || + child.tagType === ElementTypes.TEMPLATE) && hasForwardedSlots(child.children)) ) { return true