File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -883,7 +883,7 @@ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
883883 } else {
884884 // 遍历旧 children,试图寻找与 newStartVNode 拥有相同 key 值的元素
885885 const idxInOld = prevChildren .findIndex (
886- node => node .key === newStartVNode .key
886+ node => node? .key === newStartVNode .key
887887 )
888888 }
889889}
@@ -908,7 +908,7 @@ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
908908 } else {
909909 // 遍历旧 children,试图寻找与 newStartVNode 拥有相同 key 值的元素
910910 const idxInOld = prevChildren .findIndex (
911- node => node .key === newStartVNode .key
911+ node => node? .key === newStartVNode .key
912912 )
913913 if (idxInOld >= 0 ) {
914914 // vnodeToMove 就是在旧 children 中找到的节点,该节点所对应的真实 DOM 应该被移动到最前面
@@ -948,7 +948,7 @@ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
948948 // 省略...
949949 } else {
950950 const idxInOld = prevChildren .findIndex (
951- node => node .key === newStartVNode .key
951+ node => node? .key === newStartVNode .key
952952 )
953953 if (idxInOld >= 0 ) {
954954 const vnodeToMove = prevChildren[idxInOld]
@@ -991,7 +991,7 @@ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
991991 // 省略...
992992 } else {
993993 const idxInOld = prevChildren .findIndex (
994- node => node .key === newStartVNode .key
994+ node => node? .key === newStartVNode .key
995995 )
996996 if (idxInOld >= 0 ) {
997997 const vnodeToMove = prevChildren[idxInOld]
You can’t perform that action at this time.
0 commit comments