pinia-plugin-persistedstate を使用して pinia に永続性を提供し、authStore に userId メンバーを追加する

This commit is contained in:
Mouriya
2024-08-08 13:47:39 +09:00
parent 119091eaee
commit 29cfed37f4
3 changed files with 78 additions and 81 deletions

View File

@@ -1,6 +1,7 @@
import { store } from 'quasar/wrappers'
import { createPinia } from 'pinia'
import { Router } from 'vue-router';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
/*
* When adding new properties to stores, you should also
@@ -24,6 +25,7 @@ declare module 'pinia' {
export default store((/* { ssrContext } */) => {
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)
// You can add Pinia plugins here
// pinia.use(SomePiniaPlugin)