Bladeren bron

INFO: hydrate store for ssr app

master
valere 5 maanden geleden
bovenliggende
commit
51921c9213
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. +1
    -1
      stores/comment.ts

+ 1
- 1
stores/comment.ts Bestand weergeven

@@ -5,7 +5,7 @@ export const useCommentStore = defineStore('comment', {
state: () => ({
comment: useLocalStorage('comment', [])
}),
hydrate(state, initialState) {
hydrate(state, initialState) { // as nuxt is in SSR localstorage is not available so we need to hydrate the app with data first
state.comment = useLocalStorage('comment', [])
},
actions: {


Laden…
Annuleren
Opslaan