Ask a temporary problem of the array.

now there is an array list: [{name: "Xiaoguang", age: 15}, {name: "Xiaoming", age: 16}] is sent from the A page to the B page. After receiving it on the B page, how to temporarily store the array list in the defined getArr: [] on the B page? Important: the list array of page An is generated through checkbox selection, for example, if 3 are selected in checkbox, list has 3 small objects, and then you can uncheck one of them, and list becomes 2 small objects. For the list array, how to temporarily store it on page B to make it consistent with the list of page A? In addition, there are multiple checkbox groups on page A. After selecting a checkbox group, list will generate data to be transferred to page B, and then select the second checkbox group on page A, and then transfer to page B, so that page B will have two list. How to temporarily store these two list in the getArr: [] array in page B? I"m much obliged!

Apr.03,2022

I think the idea is to write an eventBus, then the B page listens, and the A page publishes.


if you don't understand the relationship between your a / b page, you can put it in storage or cookie to listen to visibilitychange paheshow when cutting flower pages, or try storage events. Try also shareworker


use cookie to store the data generated after the final operation of A page into cookie B page and load it. Page A has a new operation, update cookie

.
Menu