Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromvuejs/vue

Commit58949bd

Browse files
committed
use sameVnode check when pacthing keyed children (fixvuejs#4393)
1 parentb48c45e commit58949bd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/core/vdom/patch.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,15 +386,15 @@ export function createPatchFunction (backend) {
386386
'Make sure each v-for item has a unique key.'
387387
)
388388
}
389-
if(elmToMove.tag!==newStartVnode.tag){
390-
// same key but different element. treat as new element
391-
createElm(newStartVnode,insertedVnodeQueue,parentElm,oldStartVnode.elm)
392-
newStartVnode=newCh[++newStartIdx]
393-
}else{
389+
if(sameVnode(elmToMove,newStartVnode)){
394390
patchVnode(elmToMove,newStartVnode,insertedVnodeQueue)
395391
oldCh[idxInOld]=undefined
396392
canMove&&nodeOps.insertBefore(parentElm,newStartVnode.elm,oldStartVnode.elm)
397393
newStartVnode=newCh[++newStartIdx]
394+
}else{
395+
// same key but different element. treat as new element
396+
createElm(newStartVnode,insertedVnodeQueue,parentElm,oldStartVnode.elm)
397+
newStartVnode=newCh[++newStartIdx]
398398
}
399399
}
400400
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp