Skip to content

Commit 39d141f

Browse files
feat(docs) : Mention usage of Pinia in preFetch for SSR too (#13117)
* Correct the Pinia usage in preFetch * Update prefetch-feature.md Co-authored-by: Razvan Stoenescu <razvan.stoenescu@gmail.com>
1 parent 9879da1 commit 39d141f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/src/pages/quasar-cli-vite/prefetch-feature.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,25 @@ The `preFetch` hook runs only once, when the app boots up, so you can use this o
186186

187187
import { useMyStore } from 'stores/myStore'
188188

189+
// Non-SSR usage
190+
189191
export default {
190192
// ...
191193
preFetch () {
192194
const myStore = useMyStore()
193195
// do something with myStore
194196
}
195197
}
198+
199+
// SSR usage
200+
201+
export default {
202+
// ...
203+
preFetch ({ store }) {
204+
const myStore = useMyStore(store)
205+
// do something with myStore
206+
}
207+
}
196208
```
197209

198210
```js

0 commit comments

Comments
 (0)