diff --git a/packages/compiler-core/__tests__/transforms/vSlot.spec.ts b/packages/compiler-core/__tests__/transforms/vSlot.spec.ts index bb26d668931..4a7df1e8dfe 100644 --- a/packages/compiler-core/__tests__/transforms/vSlot.spec.ts +++ b/packages/compiler-core/__tests__/transforms/vSlot.spec.ts @@ -778,6 +778,13 @@ describe('compiler: transform component slots', () => { ) expect(slots).toMatchObject(toMatch) }) + + test('', () => { + 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 68aa1f67ccd..8fc86740eb6 100644 --- a/packages/compiler-core/src/transforms/vSlot.ts +++ b/packages/compiler-core/src/transforms/vSlot.ts @@ -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 }