Skip to content

Commit 976f2bf

Browse files
committed
(chore): persist store
1 parent a257365 commit 976f2bf

4 files changed

Lines changed: 57 additions & 2 deletions

File tree

nuxt.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default defineNuxtConfig({
3737
baseUrl: process.env.BASE_URL,
3838
},
3939
},
40-
modules: ["@pinia/nuxt"],
40+
modules: ["@pinia/nuxt", "@pinia-plugin-persistedstate/nuxt"],
4141
imports: {
4242
dirs: ["store"],
4343
},

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"devDependencies": {
1212
"@nuxt/devtools": "latest",
13+
"@pinia-plugin-persistedstate/nuxt": "^1.1.1",
1314
"@types/node": "^18",
1415
"nuxt": "^3.6.2"
1516
},

store/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,6 @@ export const useStore = defineStore("store", () => {
125125
deletePassword,
126126
updatePassword,
127127
};
128+
}, {
129+
persist: true
128130
});

yarn.lock

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,29 @@
810810
unimport "^3.0.14"
811811
untyped "^1.3.2"
812812

813+
"@nuxt/kit@^3.2.3":
814+
version "3.6.5"
815+
resolved "https://registry.yarnpkg.com/@nuxt/kit/-/kit-3.6.5.tgz#208777acdc2a09109fbe4209aad736874eb9a3f5"
816+
integrity sha512-uBI5I2Zx6sk+vRHU+nBmifwxg/nyXCGZ1g5hUKrUfgv1ZfiKB8JkN5T9iRoduDOaqbwM6XSnEl1ja73iloDcrw==
817+
dependencies:
818+
"@nuxt/schema" "3.6.5"
819+
c12 "^1.4.2"
820+
consola "^3.2.3"
821+
defu "^6.1.2"
822+
globby "^13.2.2"
823+
hash-sum "^2.0.0"
824+
ignore "^5.2.4"
825+
jiti "^1.19.1"
826+
knitwork "^1.0.0"
827+
mlly "^1.4.0"
828+
pathe "^1.1.1"
829+
pkg-types "^1.0.3"
830+
scule "^1.0.0"
831+
semver "^7.5.3"
832+
unctx "^2.3.1"
833+
unimport "^3.0.14"
834+
untyped "^1.3.2"
835+
813836
"@nuxt/schema@3.6.2", "@nuxt/schema@^3.6.1":
814837
version "3.6.2"
815838
resolved "https://registry.yarnpkg.com/@nuxt/schema/-/schema-3.6.2.tgz#762b2af9b23c0d5bfec5ef4dc00af05ba80f561e"
@@ -825,6 +848,21 @@
825848
unimport "^3.0.14"
826849
untyped "^1.3.2"
827850

851+
"@nuxt/schema@3.6.5":
852+
version "3.6.5"
853+
resolved "https://registry.yarnpkg.com/@nuxt/schema/-/schema-3.6.5.tgz#c66cf331625b41a01d510bd9e0f1227e1ff8664a"
854+
integrity sha512-UPUnMB0W5TZ/Pi1fiF71EqIsPlj8LGZqzhSf8wOeh538KHwxbA9r7cuvEUU92eXRksOZaylbea3fJxZWhOITVw==
855+
dependencies:
856+
defu "^6.1.2"
857+
hookable "^5.5.3"
858+
pathe "^1.1.1"
859+
pkg-types "^1.0.3"
860+
postcss-import-resolver "^2.0.0"
861+
std-env "^3.3.3"
862+
ufo "^1.1.2"
863+
unimport "^3.0.14"
864+
untyped "^1.3.2"
865+
828866
"@nuxt/telemetry@^2.3.0":
829867
version "2.3.1"
830868
resolved "https://registry.yarnpkg.com/@nuxt/telemetry/-/telemetry-2.3.1.tgz#f391335da53aa6458bcbc39cc44e016a90bc551a"
@@ -896,6 +934,15 @@
896934
vite-plugin-checker "^0.6.1"
897935
vue-bundle-renderer "^1.0.3"
898936

937+
"@pinia-plugin-persistedstate/nuxt@^1.1.1":
938+
version "1.1.1"
939+
resolved "https://registry.yarnpkg.com/@pinia-plugin-persistedstate/nuxt/-/nuxt-1.1.1.tgz#53d1f26fa405aa20803da6d710c6777ab50445f2"
940+
integrity sha512-b6ZNP3Re8COmfZEpj4KQmbp2TuDKrLggDFLZa8FiJF68xE/oCsPXIuXUvAt8E4ht/5sq4Z/grlA+iGXaI2aeKQ==
941+
dependencies:
942+
"@nuxt/kit" "^3.2.3"
943+
defu "^6.1.2"
944+
pinia-plugin-persistedstate ">=3.1.0"
945+
899946
"@pinia/nuxt@^0.4.11":
900947
version "0.4.11"
901948
resolved "https://registry.yarnpkg.com/@pinia/nuxt/-/nuxt-0.4.11.tgz#1b3f728ae112d45deff5971376e05b8a8d64f720"
@@ -2875,7 +2922,7 @@ globals@^11.1.0:
28752922
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
28762923
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
28772924

2878-
globby@^13.2.0, globby@^13.2.1:
2925+
globby@^13.2.0, globby@^13.2.1, globby@^13.2.2:
28792926
version "13.2.2"
28802927
resolved "https://registry.yarnpkg.com/globby/-/globby-13.2.2.tgz#63b90b1bf68619c2135475cbd4e71e66aa090592"
28812928
integrity sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==
@@ -4408,6 +4455,11 @@ pify@^3.0.0:
44084455
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176"
44094456
integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==
44104457

4458+
pinia-plugin-persistedstate@>=3.1.0:
4459+
version "3.2.0"
4460+
resolved "https://registry.yarnpkg.com/pinia-plugin-persistedstate/-/pinia-plugin-persistedstate-3.2.0.tgz#9932ca2ae88aa6c0d6763bebc6447d7bd1f097d0"
4461+
integrity sha512-tZbNGf2vjAQcIm7alK40sE51Qu/m9oWr+rEgNm/2AWr1huFxj72CjvpQcIQzMknDBJEkQznCLAGtJTIcLKrKdw==
4462+
44114463
pinia@>=2.1.0, pinia@^2.1.4:
44124464
version "2.1.4"
44134465
resolved "https://registry.yarnpkg.com/pinia/-/pinia-2.1.4.tgz#a642adfe6208e10c36d3dc16184a91064788142a"

0 commit comments

Comments
 (0)