fix(compiler-ssr): avoid unnecessary withCtx import

This commit is contained in:
Evan You
2020-04-29 16:21:54 -04:00
parent a0e2c12874
commit 08b4e8815d
2 changed files with 10 additions and 8 deletions

View File

@@ -96,10 +96,12 @@ export const ssrTransformComponent: NodeTransform = (node, context) => {
// Using the cloned node, build the normal VNode-based branches (for
// fallback in case the child is render-fn based). Store them in an array
// for later use.
buildSlots(clonedNode, context, (props, children) => {
vnodeBranches.push(createVNodeSlotBranch(props, children, context))
return createFunctionExpression(undefined)
})
if (clonedNode.children.length) {
buildSlots(clonedNode, context, (props, children) => {
vnodeBranches.push(createVNodeSlotBranch(props, children, context))
return createFunctionExpression(undefined)
})
}
const props =
node.props.length > 0