]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: explicit imports
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 29 Sep 2021 09:12:33 +0000 (11:12 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Wed, 29 Sep 2021 09:12:33 +0000 (11:12 +0200)
packages/docs/ssr/nuxt.md

index ffaed9addc305318d35e4e9a5e249dc6cc6b9479..2ea7b02cac2c6db311b53ad048361795ef90c17c 100644 (file)
@@ -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() {