Skip to content

Commit

Permalink
edit README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
l-x-f committed Mar 31, 2022
1 parent 6e606ca commit 22563e1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,27 @@ store.use(createPersistedState())
app.use(store).mount('#app')
```

use `js-cookie`

```js
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createPersistedState } from 'pinia-persistedstate-plugin'
import App from './App.vue'
import Cookies from 'js-cookie'

const app = createApp(App)
const store = createPinia()

store.use(
createPersistedState({
storage: Cookies
})
)

app.use(store).mount('#app')
```

## Options

```ts
Expand Down
21 changes: 21 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,27 @@ store.use(createPersistedState())
app.use(store).mount('#app')
```

使用 `js-cookie`

```js
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createPersistedState } from 'pinia-persistedstate-plugin'
import App from './App.vue'
import Cookies from 'js-cookie'

const app = createApp(App)
const store = createPinia()

store.use(
createPersistedState({
storage: Cookies
})
)

app.use(store).mount('#app')
```

## 选项

```ts
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pinia-persistedstate-plugin",
"version": "0.0.9",
"version": "0.1.0",
"description": "A pinia plugin like vuex-persistedstate.",
"types": "dist/index.d.ts",
"license": "MIT",
Expand Down

0 comments on commit 22563e1

Please sign in to comment.