fix(core): clone mounted hoisted vnodes on patch

...since they may need to be checked as fragment child
This commit is contained in:
Evan You
2019-12-22 13:31:13 -05:00
parent eda495efd8
commit 47a6a84631
2 changed files with 25 additions and 16 deletions

View File

@@ -353,6 +353,11 @@ export function normalizeVNode<T, U>(child: VNodeChild<T, U>): VNode<T, U> {
}
}
// optimized normalization for template-compiled render fns
export function cloneIfMounted(child: VNode): VNode {
return child.el == null ? child : cloneVNode(child)
}
export function normalizeChildren(vnode: VNode, children: unknown) {
let type = 0
if (children == null) {