I am trying to persist the state of a variable in a fresh Nuxt 3 app by using the package pinia-plugin-persistedstate
.
I've implemented the steps provided in the guide for nuxt 3:
- Created the
/plugins/persistedstate.ts
file. - Added
persist: true
option in the store file.
But nothing is happening. Whenever I refresh the page the store value is getting lost.
Can someone please help me to understand what is the issue here? Also if someone has used the package please share the steps that I may be missing while implementation.