Skip to content

Commit

Permalink
docs: auto imports
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Oct 16, 2023
1 parent f19f368 commit 152c990
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/docs/ssr/nuxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const { data } = await useAsyncData('user', () => store.fetchUser())
By default `@pinia/nuxt` exposes a few auto imports:

- `usePinia()`, which is similar to `getActivePinia()` but works better with Nuxt. You can add auto imports to make your life easier:
- `defineStore()`
- `defineStore()` to define stores
- `storeToRefs()` when you need to extract individual refs from a store
- `acceptHMRUpdate()` for [hot module replacement](../cookbook/hot-module-replacement.md)

It also automatically imports **all stores** defined withing your `stores` folder. It doesn't lookup for nested stores though. You can customize this behavior by setting the `storeDirs` option:
Expand Down

0 comments on commit 152c990

Please sign in to comment.