Store a asynchronous Search Text and store it in a separate variable and keep it INTACT

33 Views Asked by At

Is it possible storing a data asynchronously and store it separately and intact in Vue.js. Like 'Bob' search something and the search functionality works asynchronously. Bob also move to the next page to watch the search result. Want's to keep the data in Vue.js in a separate variable without replacing it with another search. Suppose Bob searched 'Car Toy' and waits for 5 seconds in the page. I want to store the 'Car Toy' in a variable in Vue.js. Then after 5 seconds if Bob search 'Horse Toy' I want to save it in another variable. And if possible I want to destroy the data when the session period is over or after a specific time or duration. is it possible in Vue.js and how can I implement this. Can you share your code to help me.....

1

There are 1 best solutions below

0
On

You can use vuex, but i will not show you how the code should be, you can store the varieble in vuex, then you can retrieve them even if you move from one route to another route