简体   繁体   中英

Vuex LocaleStorage plugin for nuxt.js

In my project, I faced with a problem the cookie technology and I can't use it because my client gets problems with it because cookies should have some button for notification, and the user might not approve it.

My question is:
Are there any solutions (modules possible) to solve such problems? If yes - what can you recommend first of all?

In my project, I need to get data in middleware(in SSR mode) from VUEX and I need to save it after refresh pages.

If it possible - need to save session data for other browsers or another tab's the current browser. Is it real without a cookie using?

If you want to persist Vuex Data you can use vuex-persist

Which will persist your data on-page.

With vuex-persist you have 3-4 options to store vuex data

  1. js-cookie to use browser Cookies
  2. window.localStorage (remains, across PC reboots, untill you clear browser data)
  3. window.sessionStorage (vanishes when you close browser tab)
  4. localForage Uses IndexedDB from the browser

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM