Skip to content

Commit 3af421c

Browse files
committed
fix(server-renderer): Scoped data attributes aren't passed down to functional components vuejs#5817
1 parent 4a3237a commit 3af421c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/server-renderer/src/helpers/ssrRenderComponent.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { isFunction } from '@vue/shared'
12
import { Component, ComponentInternalInstance, createVNode, Slots } from 'vue'
23
import { Props, renderComponentVNode, SSRBuffer } from '../render'
34
import { SSRSlots } from './ssrRenderSlot'
@@ -10,7 +11,9 @@ export function ssrRenderComponent(
1011
slotScopeId?: string
1112
): SSRBuffer | Promise<SSRBuffer> {
1213
return renderComponentVNode(
13-
createVNode(comp, props, children),
14+
isFunction(comp) && parentComponent
15+
? (parentComponent.subTree = createVNode(comp, props, children))
16+
: createVNode(comp, props, children),
1417
parentComponent,
1518
slotScopeId
1619
)

0 commit comments

Comments
 (0)