Use Pinia with stores from different locations #17209
-
The typical setup for pinia in quasar is to have the stores in the "src/stores" folder; creating a store with the cli will make sure I have the index.ts file (and maybe the store-flag.d.ts file too?). This setup works perfectly, but when I want to create an additional store at another location (say, "src/somefeature/stores"), although everything seems ok, the store will not work (I mean it is not reactive). So, before spending too much time figuring out how this might work, I'd like to ask if this is supported at all? Is pinia in quasar meant to be used in such a way? Or should the stores all be placed in that fixed "src/stores" folder? Thanks so much! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
I think you got me wrong. That path is only used for the
index.ts
andstore-flag.d.ts
. For defining the stores, you can use it, but not limited to this path. So, you should already be able to achieve what you said. If as you said, there is a reactivity problem, then you can share a reproduction so we can inspect it.