]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: auto imports
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 16 Oct 2023 09:50:48 +0000 (11:50 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 16 Oct 2023 09:50:56 +0000 (11:50 +0200)
packages/docs/ssr/nuxt.md

index 6d73bb0a461e18b54cb9d997ad64ea713a6685db..95e7e3878b2c50b34c6ea92339088c1adf2e3cd9 100644 (file)
@@ -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: