@@ -6,10 +6,12 @@ export function ssrRenderComponent(
|
||||
comp: Component,
|
||||
props: Props | null = null,
|
||||
children: Slots | SSRSlots | null = null,
|
||||
parentComponent: ComponentInternalInstance | null = null
|
||||
parentComponent: ComponentInternalInstance | null = null,
|
||||
slotScopeId?: string
|
||||
): SSRBuffer | Promise<SSRBuffer> {
|
||||
return renderComponentVNode(
|
||||
createVNode(comp, props, children),
|
||||
parentComponent
|
||||
parentComponent,
|
||||
slotScopeId
|
||||
)
|
||||
}
|
||||
|
||||
@@ -15,13 +15,13 @@ export function ssrRenderSlot(
|
||||
slotProps: Props,
|
||||
fallbackRenderFn: (() => void) | null,
|
||||
push: PushFn,
|
||||
parentComponent: ComponentInternalInstance
|
||||
parentComponent: ComponentInternalInstance,
|
||||
slotScopeId?: string | null
|
||||
) {
|
||||
// template-compiled slots are always rendered as fragments
|
||||
push(`<!--[-->`)
|
||||
const slotFn = slots[slotName]
|
||||
if (slotFn) {
|
||||
const scopeId = parentComponent && parentComponent.type.__scopeId
|
||||
const slotBuffer: SSRBufferItem[] = []
|
||||
const bufferedPush = (item: SSRBufferItem) => {
|
||||
slotBuffer.push(item)
|
||||
@@ -30,7 +30,7 @@ export function ssrRenderSlot(
|
||||
slotProps,
|
||||
bufferedPush,
|
||||
parentComponent,
|
||||
scopeId ? ` ${scopeId}-s` : ``
|
||||
slotScopeId ? ' ' + slotScopeId : ''
|
||||
)
|
||||
if (Array.isArray(ret)) {
|
||||
// normal slot
|
||||
|
||||
Reference in New Issue
Block a user