wip(ssr): basic components

This commit is contained in:
Evan You
2020-02-05 23:07:23 -05:00
parent 27e2e482e9
commit ee5ed73361
20 changed files with 254 additions and 132 deletions

View File

@@ -27,6 +27,7 @@ import { SSRSlots } from './helpers/renderSlot'
const {
isVNode,
createComponentInstance,
setCurrentRenderingInstance,
setupComponent,
renderComponentRoot,
normalizeVNode
@@ -135,7 +136,10 @@ function renderComponentSubTree(
} else {
if (comp.ssrRender) {
// optimized
// set current rendering instance for asset resoolution
setCurrentRenderingInstance(instance)
comp.ssrRender(instance.proxy, push, instance)
setCurrentRenderingInstance(null)
} else if (comp.render) {
renderVNode(push, renderComponentRoot(instance), instance)
} else {