|
@@ -191,7 +191,21 @@ function renderAsyncComponent (node, isRoot, context) {
|
|
|
tag
|
|
tag
|
|
|
)
|
|
)
|
|
|
if (resolvedNode) {
|
|
if (resolvedNode) {
|
|
|
- renderComponent(resolvedNode, isRoot, context)
|
|
|
|
|
|
|
+ if (resolvedNode.componnetInstance) {
|
|
|
|
|
+ renderComponent(resolvedNode, isRoot, context)
|
|
|
|
|
+ } else if (!Array.isArray(resolvedNode)) {
|
|
|
|
|
+ // single return node from functional component
|
|
|
|
|
+ renderNode(resolvedNode, isRoot, context)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // multiple return nodes from functional component
|
|
|
|
|
+ context.renderStates.push({
|
|
|
|
|
+ type: 'Fragment',
|
|
|
|
|
+ children: resolvedNode,
|
|
|
|
|
+ rendered: 0,
|
|
|
|
|
+ total: resolvedNode.length
|
|
|
|
|
+ })
|
|
|
|
|
+ context.next()
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
// invalid component, but this does not throw on the client
|
|
// invalid component, but this does not throw on the client
|
|
|
// so render empty comment node
|
|
// so render empty comment node
|
|
@@ -232,9 +246,10 @@ function renderStringNode (el, context) {
|
|
|
const children: Array<VNode> = el.children
|
|
const children: Array<VNode> = el.children
|
|
|
context.renderStates.push({
|
|
context.renderStates.push({
|
|
|
type: 'Element',
|
|
type: 'Element',
|
|
|
|
|
+ children,
|
|
|
rendered: 0,
|
|
rendered: 0,
|
|
|
total: children.length,
|
|
total: children.length,
|
|
|
- endTag: el.close, children
|
|
|
|
|
|
|
+ endTag: el.close
|
|
|
})
|
|
})
|
|
|
write(el.open, next)
|
|
write(el.open, next)
|
|
|
}
|
|
}
|
|
@@ -263,9 +278,10 @@ function renderElement (el, isRoot, context) {
|
|
|
const children: Array<VNode> = el.children
|
|
const children: Array<VNode> = el.children
|
|
|
context.renderStates.push({
|
|
context.renderStates.push({
|
|
|
type: 'Element',
|
|
type: 'Element',
|
|
|
|
|
+ children,
|
|
|
rendered: 0,
|
|
rendered: 0,
|
|
|
total: children.length,
|
|
total: children.length,
|
|
|
- endTag, children
|
|
|
|
|
|
|
+ endTag
|
|
|
})
|
|
})
|
|
|
write(startTag, next)
|
|
write(startTag, next)
|
|
|
}
|
|
}
|