perf(transform-vif): don't need to createBlock for a component (#853)
This commit is contained in:
@@ -212,7 +212,12 @@ function createChildrenCodegenNode(
|
||||
const vnodeCall = (firstChild as ElementNode)
|
||||
.codegenNode as BlockCodegenNode
|
||||
// Change createVNode to createBlock.
|
||||
if (vnodeCall.type === NodeTypes.VNODE_CALL) {
|
||||
if (
|
||||
vnodeCall.type === NodeTypes.VNODE_CALL &&
|
||||
// component vnodes are always tracked and its children are
|
||||
// compiled into slots so no need to make it a block
|
||||
(firstChild as ElementNode).tagType !== ElementTypes.COMPONENT
|
||||
) {
|
||||
vnodeCall.isBlock = true
|
||||
helper(OPEN_BLOCK)
|
||||
helper(CREATE_BLOCK)
|
||||
|
||||
Reference in New Issue
Block a user