I am using local storage in vue form generator where I am storing the user entered value temporary in a browser. So after submitting the form local storage value will vanish completely.
But in my case I have some issues Like in our site we have two different user One is business user and other is personal user So the issue is If we are storing the local storage value in business login user and if we logout from the session and we will login with different user as personal user Then the same value is displaying in other logged in user. So how to prevent this in vfg.
Here is my code which I have implemented.
if (localStorage.getItem('model') !== null)
this.model=JSON.parse(localStorage.getItem('model'));
},
localStorage.setItem('model', JSON.stringify(this.model));
Using vfg model I am saving the value in local storage. So please if anyone Have an Idea please help me
Top comments (0)