npm i pinia-plugin-persistedstate
import { createPinia } from 'pinia' import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' const pinia = createPinia() pinia.use(piniaPluginPersistedstate)
import { defineStore } from 'pinia' export const useStore = defineStore('store', { state: () => ({ someState: 'hello pinia', }), persist: true, })