How to fix local storage issue in vue_form_generator

alam487

Alam487

Posted on December 7, 2021

How to fix local storage issue in vue_form_generator

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'));
  },
Enter fullscreen mode Exit fullscreen mode
localStorage.setItem('model', JSON.stringify(this.model));
Enter fullscreen mode Exit fullscreen mode

Using vfg model I am saving the value in local storage. So please if anyone Have an Idea please help me

💖 💪 🙅 🚩
alam487
Alam487

Posted on December 7, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024

Modern C++ for LeetCode 🧑‍💻🚀
leetcode Modern C++ for LeetCode 🧑‍💻🚀

November 29, 2024