fix(ssr): hydration for transition wrapper components with empty slot content (#5995)
fix #5991
This commit is contained in:
@@ -123,7 +123,7 @@ describe('ssr: <slot>', () => {
|
||||
"const { ssrRenderSlotInner: _ssrRenderSlotInner } = require(\\"vue/server-renderer\\")
|
||||
|
||||
return function ssrRender(_ctx, _push, _parent, _attrs) {
|
||||
_ssrRenderSlotInner(_ctx.$slots, \\"default\\", {}, null, _push, _parent)
|
||||
_ssrRenderSlotInner(_ctx.$slots, \\"default\\", {}, null, _push, _parent, null, true)
|
||||
}"
|
||||
`)
|
||||
})
|
||||
|
||||
@@ -50,6 +50,10 @@ export const ssrTransformSlotOutlet: NodeTransform = (node, context) => {
|
||||
parent.children.filter(c => c.type === NodeTypes.ELEMENT).length === 1
|
||||
) {
|
||||
method = SSR_RENDER_SLOT_INNER
|
||||
if (!(context.scopeId && context.slotted !== false)) {
|
||||
args.push('null')
|
||||
}
|
||||
args.push('true')
|
||||
}
|
||||
|
||||
node.ssrCodegenNode = createCallExpression(context.helper(method), args)
|
||||
|
||||
Reference in New Issue
Block a user