ASK - how to implement using vue vite without nuxt on cookies storage?
syukriyansyah-ipb opened this issue · 1 comments
syukriyansyah-ipb commented
ASK - how to implement using vue vite without nuxt on cookies storage?
soc221b commented
It's similar to https://github.com/iendeavor/pinia-plugin-persistedstate-2/tree/main/examples/nuxt-bridge-example:
import cookie from 'js-cookie'
const persistedStatePlugin = createPersistedStatePlugin({
storage: {
getItem: async (key) => {
return cookie.get(key)
},
setItem: async (key, value) => {
cookie.set(key, value)
},
removeItem: async (key) => {
return cookie.remove(key)
},
},
})
// ...
https://github.com/iendeavor/pinia-plugin-persistedstate-2#storage