核心思想 以新Node 为标杆 oldNode 为 真实DoM的映射(如果可以 尽可能的利用已有的oLdNode 的资源) 最大程度的减少真实dom的操作
function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
/** /
let oldStartIdx = 0
let newStartIdx = 0
/* /
let oldEndIdx = oldCh.length - 1
let newEndIdx = newCh.length - 1
/* /
let oldStartVnode = oldCh[0]
let newStartVnode = newCh[0]
/* */
let oldEndVnode = oldCh[oldEndIdx]
let newEndVnode = newCh[newEndIdx]
let oldKeyToIdx, /**oldNode 的keys Map集合 */
idxInOld, /*Vnode的当前newStartIdx 对应的child oldNode 孩子中的index /
vnodeToMove, / 需要移动的老孩子 */
refElm /**oldNode 的keys Map集合 */
// removeOnly is a special flag used only by
// to ensure removed elements stay in correct relative positions
// during leaving transitions
const canMove = !removeOnl