From 8eaf38e59cfc9be345dcbdfbf4b6f7dec89c420d Mon Sep 17 00:00:00 2001 From: Jerry Chen <1558267774@qq.com> Date: Wed, 25 Mar 2020 23:49:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DupdateChildren=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...alDOM\344\270\216diff(Vue\345\256\236\347\216\260).MarkDown" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/docs/VirtualDOM\344\270\216diff(Vue\345\256\236\347\216\260).MarkDown" "b/docs/VirtualDOM\344\270\216diff(Vue\345\256\236\347\216\260).MarkDown" index 2bf4641..7726667 100644 --- "a/docs/VirtualDOM\344\270\216diff(Vue\345\256\236\347\216\260).MarkDown" +++ "b/docs/VirtualDOM\344\270\216diff(Vue\345\256\236\347\216\260).MarkDown" @@ -383,7 +383,7 @@ patchVnode的规则是这样的: /*因为已经patchVnode进去了,所以将这个老节点赋值undefined,之后如果还有新节点与该节点key相同可以检测出来提示已有重复的key*/ oldCh[idxInOld] = undefined /*当有标识位canMove实可以直接插入oldStartVnode对应的真实DOM节点前面*/ - canMove && nodeOps.insertBefore(parentElm, newStartVnode.elm, oldStartVnode.elm) + canMove && nodeOps.insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm) newStartVnode = newCh[++newStartIdx] } else { // same key but different element. treat as new element