]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: nested stores imports
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 31 Jul 2023 07:13:59 +0000 (09:13 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 31 Jul 2023 07:13:59 +0000 (09:13 +0200)
packages/nuxt/playground/app.vue
packages/nuxt/playground/nuxt.config.ts
packages/nuxt/src/module.ts

index 02df7895adfc138fd5320be39194a97ddfc70526..68e0c306f7a40e39c411b254db911ed589074f45 100644 (file)
@@ -4,6 +4,7 @@
 const counter = useCounter()
 
 useTestStore()
+useSomeStoreStore()
 
 if (process.server) {
   counter.increment()
index 2659d2a80a62b58a23f84881869ccbc3b1e6fff4..947ebaffc6394938581a59053981ef1029e26888 100644 (file)
@@ -9,7 +9,7 @@ export default defineNuxtConfig({
   modules: [piniaModule],
 
   pinia: {
-    storesDirs: ['./stores', './domain/*/stores'],
+    storesDirs: ['./stores/**', './domain/*/stores'],
   },
 
   vite: {
index 72d473374d016c646f4f95c69cb6988ec9a371d5..e02f61177cbf9f5d34f94ce71d636de0853222a9 100644 (file)
@@ -23,7 +23,8 @@ export interface ModuleOptions {
 
   /**
    * Automatically add stores dirs to the auto imports. This is the same as
-   * directly adding the dirs to the `imports.dirs` option.
+   * directly adding the dirs to the `imports.dirs` option. If you want to
+   * also import nested stores, you can use the glob pattern `./stores/**`
    *
    * @default `['./stores']`
    */