File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -285,11 +285,13 @@ export default class Node {
285285
286286 removeChildByData ( data ) {
287287 let targetNode = null ;
288- this . childNodes . forEach ( node => {
289- if ( node . data === data ) {
290- targetNode = node ;
288+
289+ for ( let i = 0 ; i < this . childNodes . length ; i ++ ) {
290+ if ( this . childNodes [ i ] === data ) {
291+ targetNode = this . childNodes [ i ] ;
292+ break ;
291293 }
292- } ) ;
294+ }
293295
294296 if ( targetNode ) {
295297 this . removeChild ( targetNode ) ;
@@ -442,9 +444,11 @@ export default class Node {
442444 }
443445 } ) ;
444446
445- oldData . forEach ( ( item ) => {
446- if ( ! newDataMap [ item [ NODE_KEY ] ] ) this . removeChildByData ( item ) ;
447- } ) ;
447+ if ( ! this . store . lazy ) {
448+ oldData . forEach ( ( item ) => {
449+ if ( ! newDataMap [ item [ NODE_KEY ] ] ) this . removeChildByData ( item ) ;
450+ } ) ;
451+ }
448452
449453 newNodes . forEach ( ( { index, data } ) => {
450454 this . insertChild ( { data } , index ) ;
You can’t perform that action at this time.
0 commit comments