Seb-L / pinia-plugin-persist

Persist pinia state data in sessionStorage or other storages.
https://Seb-L.github.io/pinia-plugin-persist/
MIT License
214 stars 37 forks source link

Nuxt 2 TS error #65

Open avxkim opened 1 year ago

avxkim commented 1 year ago

I'm using Vue 2.7 + Nuxt 2.16 + @nuxtjs/composition API

export const useDictionaryStore = defineStore(
  'dictionary',
  () => {
    // ...code removed

    return {
       someData,
    }
  },
  {
    persist: {
      enabled: true,
      strategies: [
        {
          storage: localStorage,
        },
      ],
    },
  }
)

Getting TS error: Argument of type '{ persist: { enabled: boolean; strategies: { storage: Storage; }[]; }; }' is not assignable to parameter of type 'DefineSetupStoreOptions<"dictionary", _UnwrapAll

Even though i've added types in tsconfig.json