Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
Fixes #227 - Update NuxtJS instructions (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiofdsantos authored May 7, 2020
1 parent 5313b16 commit 926dba3
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Or configured to use with [secure-ls](https://github.com/softvar/secure-ls)

### Nuxt.js

It is possible to use vuex-persistedstate with Nuxt.js. Due to the order code is loaded in, vuex-persistedstate must be included as a NuxtJS plugin:
It is possible to use vuex-persistedstate with Nuxt.js. It must be included as a NuxtJS plugin:

```javascript
// nuxt.config.js
Expand All @@ -73,13 +73,11 @@ plugins: [{ src: '~/plugins/localStorage.js', ssr: false }]
import createPersistedState from 'vuex-persistedstate'

export default ({store}) => {
window.onNuxtReady(() => {
createPersistedState({
key: 'yourkey',
paths: [...]
...
})(store)
})
createPersistedState({
key: 'yourkey',
paths: [...]
...
})(store)
}
```

Expand Down

0 comments on commit 926dba3

Please sign in to comment.