File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -330,6 +330,54 @@ const mutations = {
330
330
}
331
331
}
332
332
}
333
+ //
334
+ for ( const item of Object . values ( state . componentMap ) ) {
335
+ if ( item . htmlList ) {
336
+ const newArray = [ ...item . htmlList ] ;
337
+
338
+ const changeAllChildComponents = ( array , name ) => {
339
+ const queue = [ ...array . filter ( el => typeof el === 'object' ) ] ;
340
+ while ( queue . length ) {
341
+ const evaluate = queue . shift ( ) ;
342
+ if ( evaluate . text === name ) {
343
+ evaluate . text = payload ;
344
+ }
345
+ for ( let i = 0 ; i < evaluate . children . length ; i ++ ) {
346
+ if ( evaluate . children [ i ] . text === name ) {
347
+ evaluate . children [ i ] . text = payload ;
348
+ }
349
+ if ( evaluate . children . length ) {
350
+ queue . push ( ...evaluate . children )
351
+ }
352
+ }
353
+ }
354
+ }
355
+
356
+ changeAllChildComponents ( newArray , temp )
357
+ item . htmlList = newArray
358
+ }
359
+ }
360
+ /*
361
+ const breadthFirstSearchParent = (array, id) => {
362
+ const queue = [...array.filter(el => typeof el === 'object')]
363
+ while (queue.length) {
364
+ const evaluated = queue.shift()
365
+ for (let i = 0; i < evaluated.children.length; i++) {
366
+ if (evaluated.children[i].id === id) {
367
+ return {
368
+ evaluated,
369
+ index: i
370
+ }
371
+ }
372
+ if (evaluated.children.length) {
373
+ queue.push(...evaluated.children)
374
+ }
375
+ }
376
+ }
377
+ }
378
+ */
379
+
380
+
333
381
} ,
334
382
335
383
// *** HTML ELEMENTS *** //////////////////////////////////////////////
You can’t perform that action at this time.
0 commit comments