test(ssr): test for rendering components

This commit is contained in:
Evan You
2020-01-29 16:46:18 -05:00
parent 6e06810add
commit 8cdaf28515
4 changed files with 267 additions and 21 deletions

View File

@@ -125,7 +125,7 @@ function renderComponentSubTree(
} else {
if (comp.ssrRender) {
// optimized
comp.ssrRender(push, instance.proxy)
comp.ssrRender(instance.proxy, push, instance)
} else if (comp.render) {
renderVNode(push, renderComponentRoot(instance), instance)
} else {
@@ -260,8 +260,8 @@ export function renderSlot(
) {
// template-compiled slots are always rendered as fragments
push(`<!---->`)
if (slotFn.length > 2) {
// only ssr-optimized slot fns accept 3 arguments
if (slotFn.length > 1) {
// only ssr-optimized slot fns accept more than 1 arguments
slotFn(slotProps, push, parentComponent)
} else {
// normal slot