fix: mounting new children

This commit is contained in:
Evan You 2019-12-22 16:24:24 -05:00
parent 2fdb499bd9
commit 7d436ab59a
2 changed files with 4 additions and 5 deletions

View File

@ -1310,13 +1310,12 @@ export function createRenderer<
const nextPos = e2 + 1
const anchor =
nextPos < l2 ? (c2[nextPos] as HostVNode).el : parentAnchor
const n2 = (c2[i] = optimized
? cloneIfMounted(c2[i] as HostVNode)
: normalizeVNode(c2[i]))
while (i <= e2) {
patch(
null,
n2,
(c2[i] = optimized
? cloneIfMounted(c2[i] as HostVNode)
: normalizeVNode(c2[i])),
container,
anchor,
parentComponent,

View File

@ -355,7 +355,7 @@ 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)
return child.el === null ? child : cloneVNode(child)
}
export function normalizeChildren(vnode: VNode, children: unknown) {