|
|
@@ -673,9 +673,12 @@ export function createPatchFunction (backend) {
|
|
|
// create an empty node and replace it
|
|
|
oldVnode = emptyNodeAt(oldVnode)
|
|
|
}
|
|
|
+
|
|
|
// replacing existing element
|
|
|
const oldElm = oldVnode.elm
|
|
|
const parentElm = nodeOps.parentNode(oldElm)
|
|
|
+
|
|
|
+ // create new node
|
|
|
createElm(
|
|
|
vnode,
|
|
|
insertedVnodeQueue,
|
|
|
@@ -686,9 +689,8 @@ export function createPatchFunction (backend) {
|
|
|
nodeOps.nextSibling(oldElm)
|
|
|
)
|
|
|
|
|
|
+ // update parent placeholder node element, recursively
|
|
|
if (isDef(vnode.parent)) {
|
|
|
- // component root element replaced.
|
|
|
- // update parent placeholder node element, recursively
|
|
|
let ancestor = vnode.parent
|
|
|
const patchable = isPatchable(vnode)
|
|
|
while (ancestor) {
|
|
|
@@ -717,6 +719,7 @@ export function createPatchFunction (backend) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // destroy old node
|
|
|
if (isDef(parentElm)) {
|
|
|
removeVnodes(parentElm, [oldVnode], 0, 0)
|
|
|
} else if (isDef(oldVnode.tag)) {
|