Skip to content

Commit

Permalink
fix: mounting new children
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 22, 2019
1 parent 2fdb499 commit 7d436ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions packages/runtime-core/src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/vnode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 7d436ab

Please sign in to comment.