Hybrid development, both pages have search function, use localstorage to achieve historical search, but will share! Excuse me, how can we not share?

hybrid development, both pages have search function, use localstorage to achieve historical search, but will share! How can I avoid sharing? the localstorage data of page A will not affect page B

.

distinguish between key values

the history search storage mode of

A page
localStorage.setItem ('keyA',vala);


localStorage.setItem ('keyB',valb);

the history search storage mode of

B pages

take values on demand when fetching data

Menu