From: Eduardo San Martin Morote Date: Mon, 31 Jul 2023 07:13:59 +0000 (+0200) Subject: docs: nested stores imports X-Git-Tag: @pinia/nuxt@0.5.0~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6c34a0679ae61efd0a700a5abb7c85b20f300967;p=thirdparty%2Fvuejs%2Fpinia.git docs: nested stores imports --- diff --git a/packages/nuxt/playground/app.vue b/packages/nuxt/playground/app.vue index 02df7895..68e0c306 100644 --- a/packages/nuxt/playground/app.vue +++ b/packages/nuxt/playground/app.vue @@ -4,6 +4,7 @@ const counter = useCounter() useTestStore() +useSomeStoreStore() if (process.server) { counter.increment() diff --git a/packages/nuxt/playground/nuxt.config.ts b/packages/nuxt/playground/nuxt.config.ts index 2659d2a8..947ebaff 100644 --- a/packages/nuxt/playground/nuxt.config.ts +++ b/packages/nuxt/playground/nuxt.config.ts @@ -9,7 +9,7 @@ export default defineNuxtConfig({ modules: [piniaModule], pinia: { - storesDirs: ['./stores', './domain/*/stores'], + storesDirs: ['./stores/**', './domain/*/stores'], }, vite: { diff --git a/packages/nuxt/src/module.ts b/packages/nuxt/src/module.ts index 72d47337..e02f6117 100644 --- a/packages/nuxt/src/module.ts +++ b/packages/nuxt/src/module.ts @@ -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']` */