fix(runtime-core): fix missed updates when passing vnode to <component :is>

fix #4903
This commit is contained in:
Evan You 2022-05-12 17:52:15 +08:00
parent 0f00cf43cf
commit ba17792b72

View File

@ -510,6 +510,14 @@ function _createVNode(
if (children) {
normalizeChildren(cloned, children)
}
if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
if (cloned.shapeFlag & ShapeFlags.COMPONENT) {
currentBlock[currentBlock.indexOf(type)] = cloned
} else {
currentBlock.push(cloned)
}
}
cloned.patchFlag |= PatchFlags.BAIL
return cloned
}