Skip to content

Commit

Permalink
[FEAT] add pinia persistance
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsAnunesS committed Jan 12, 2025
1 parent 234ddaa commit 7ada437
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
Binary file modified bun.lockb
Binary file not shown.
8 changes: 7 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
export default defineNuxtConfig({
compatibilityDate: '2024-11-01',
devtools: { enabled: true },
modules: ['@nuxtjs/supabase', '@nuxtjs/tailwindcss', '@nuxtjs/i18n', '@pinia/nuxt'],
modules: [
'@nuxtjs/supabase',
'@nuxtjs/tailwindcss',
'@pinia/nuxt',
'pinia-plugin-persistedstate/nuxt',
'@nuxtjs/i18n',
],
supabase: {
redirect: false,
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"@pinia/nuxt": "0.9.0",
"nuxt": "^3.15.1",
"pinia": "^2.3.0",
"pinia-plugin-persistedstate": "^4.2.0",
"vue": "latest",
"vue-router": "latest"
},
Expand Down
11 changes: 11 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script setup lang="ts">
</script>

<template>

</template>

<style scoped>
</style>
2 changes: 2 additions & 0 deletions stores/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ export const useLanguageStore = defineStore('language', () => {
};

return { languages, current, changeLocale }
},{
persist: true,
})
2 changes: 2 additions & 0 deletions stores/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ export const useUserStore = defineStore('user', () => {
};

return { name, language, theme, updateLanguage }
}, {
persist: true,
})

0 comments on commit 7ada437

Please sign in to comment.