problem description
when you use Nuxt.js to develop a server-side rendering project, refreshing the web page will cause data saved to vuex store
to be lost.
if it is token
, then I will save it to cookie
, get token
in cookie
when nuxtServerInit
, and reset it to store
.
but if I have other data to cache, such as product categories, etc., which I don"t want to set to cookie
, but rather want to save to sessionStorage
, what should I do if I extract data from sessionStorage
to store
after the page is loaded? There may be a lot of cached data, so you want to find a place to configure it separately, instead of writing it once for every page, where should it be written? Or can only be done with cookie, like token? )