|
|
@@ -386,15 +386,15 @@ export function createPatchFunction (backend) {
|
|
|
'Make sure each v-for item has a unique key.'
|
|
|
)
|
|
|
}
|
|
|
- if (elmToMove.tag !== newStartVnode.tag) {
|
|
|
- // same key but different element. treat as new element
|
|
|
- createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm)
|
|
|
- newStartVnode = newCh[++newStartIdx]
|
|
|
- } else {
|
|
|
+ if (sameVnode(elmToMove, newStartVnode)) {
|
|
|
patchVnode(elmToMove, newStartVnode, insertedVnodeQueue)
|
|
|
oldCh[idxInOld] = undefined
|
|
|
canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm)
|
|
|
newStartVnode = newCh[++newStartIdx]
|
|
|
+ } else {
|
|
|
+ // same key but different element. treat as new element
|
|
|
+ createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm)
|
|
|
+ newStartVnode = newCh[++newStartIdx]
|
|
|
}
|
|
|
}
|
|
|
}
|