From: Eduardo San Martin Morote Date: Wed, 29 Sep 2021 09:12:33 +0000 (+0200) Subject: docs: explicit imports X-Git-Tag: pinia@2.0.0-rc.10~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a741adc2627bdfabaa9a07a4c00f91c31aabfdf2;p=thirdparty%2Fvuejs%2Fpinia.git docs: explicit imports --- diff --git a/packages/docs/ssr/nuxt.md b/packages/docs/ssr/nuxt.md index ffaed9ad..2ea7b02c 100644 --- a/packages/docs/ssr/nuxt.md +++ b/packages/docs/ssr/nuxt.md @@ -33,6 +33,8 @@ And that's it, use your store as usual! If you want to use a store outside of `setup()`, remember to pass the `pinia` object to `useStore()`. We added it to [the context](https://nuxtjs.org/docs/2.x/internals-glossary/context) so you have access to it in `asyncData()` and `fetch()`: ```js +import { useStore } from '~/stores/myStore' + export default { asyncData({ pinia }) { const store = useStore(pinia) @@ -45,6 +47,8 @@ export default { You can also use [the context](https://nuxtjs.org/docs/2.x/internals-glossary/context) in any store by using the injected property `$nuxt`: ```js +import { useUserStore } from '~/stores/userStore' + defineStore('cart', { actions: { purchase() {