From 102923a5aadbad19b6636a3bce43626e199781f6 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 19 Aug 2021 23:24:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/wrapper/layout.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index 72ab6a1f4..d34424eb3 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -441,7 +441,7 @@ BI.Layout = BI.inherit(BI.Widget, { } else { var sameOldVnode = findOldVnode(oldCh, newStartVnode, oldStartIdx, oldEndIdx); if (BI.isNull(sameOldVnode)) { // 不存在就把新的放到左边 - var node = addNode(newStartVnode); + var node = addNode(newStartVnode, newStartIdx); insertBefore(node, oldStartVnode); newStartVnode = newCh[++newStartIdx]; } else { // 如果新节点在就旧节点区间中存在就复用一下 @@ -486,7 +486,7 @@ BI.Layout = BI.inherit(BI.Widget, { function addNode (vnode, index) { var opt = self._getOptions(vnode); var key = opt.key == null ? index : opt.key; - return children[key] = self._addElement(key, vnode); + return children[key] = self._addElement(index, vnode); } function addVnodes (before, vnodes, startIdx, endIdx) {