refactor(ssr): adjust ssr scope id logic for client-compiled render functions

This commit is contained in:
Evan You
2021-03-30 19:30:05 -04:00
parent 5e54081d5b
commit 58e2376c4d
3 changed files with 57 additions and 49 deletions

View File

@@ -16,7 +16,7 @@ export function ssrRenderSlot(
fallbackRenderFn: (() => void) | null,
push: PushFn,
parentComponent: ComponentInternalInstance,
slotScopeId?: string | null
slotScopeId?: string
) {
// template-compiled slots are always rendered as fragments
push(`<!--[-->`)
@@ -34,7 +34,7 @@ export function ssrRenderSlot(
)
if (Array.isArray(ret)) {
// normal slot
renderVNodeChildren(push, ret, parentComponent)
renderVNodeChildren(push, ret, parentComponent, slotScopeId)
} else {
// ssr slot.
// check if the slot renders all comments, in which case use the fallback