mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-04 04:57:40 +08:00
refactor: rename variable
This commit is contained in:
parent
9734e878ec
commit
9761072d93
@ -369,7 +369,7 @@ export function createPatchFunction (backend) {
|
|||||||
let newEndIdx = newCh.length - 1
|
let newEndIdx = newCh.length - 1
|
||||||
let newStartVnode = newCh[0]
|
let newStartVnode = newCh[0]
|
||||||
let newEndVnode = newCh[newEndIdx]
|
let newEndVnode = newCh[newEndIdx]
|
||||||
let oldKeyToIdx, idxInOld, elmToMove, refElm
|
let oldKeyToIdx, idxInOld, vnodeToMove, refElm
|
||||||
|
|
||||||
// removeOnly is a special flag used only by <transition-group>
|
// removeOnly is a special flag used only by <transition-group>
|
||||||
// to ensure removed elements stay in correct relative positions
|
// to ensure removed elements stay in correct relative positions
|
||||||
@ -407,18 +407,18 @@ export function createPatchFunction (backend) {
|
|||||||
if (isUndef(idxInOld)) { // New element
|
if (isUndef(idxInOld)) { // New element
|
||||||
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm)
|
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm)
|
||||||
} else {
|
} else {
|
||||||
elmToMove = oldCh[idxInOld]
|
vnodeToMove = oldCh[idxInOld]
|
||||||
/* istanbul ignore if */
|
/* istanbul ignore if */
|
||||||
if (process.env.NODE_ENV !== 'production' && !elmToMove) {
|
if (process.env.NODE_ENV !== 'production' && !vnodeToMove) {
|
||||||
warn(
|
warn(
|
||||||
'It seems there are duplicate keys that is causing an update error. ' +
|
'It seems there are duplicate keys that is causing an update error. ' +
|
||||||
'Make sure each v-for item has a unique key.'
|
'Make sure each v-for item has a unique key.'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (sameVnode(elmToMove, newStartVnode)) {
|
if (sameVnode(vnodeToMove, newStartVnode)) {
|
||||||
patchVnode(elmToMove, newStartVnode, insertedVnodeQueue)
|
patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue)
|
||||||
oldCh[idxInOld] = undefined
|
oldCh[idxInOld] = undefined
|
||||||
canMove && nodeOps.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm)
|
canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm)
|
||||||
} else {
|
} else {
|
||||||
// same key but different element. treat as new element
|
// same key but different element. treat as new element
|
||||||
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm)
|
createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm)
|
||||||
|
Loading…
Reference in New Issue
Block a user