How can I import a Pinia store globally so I don't have to import it in every single component? #2309
-
I love Vue and Pinia, but there is one thing that is driving me insane. I have some Pinia stores that I end up importing in almost all of my components. This gets very tedious, even with autocomplete. I would love a way that I can say "hey, this store should be globally accessible" so I don't need to import it every time manually. Does anyone know of a way how to do that? I am using the composition API... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Use auto imports: https://github.com/antfu/unplugin-auto-import Nuxt has it by default |
Beta Was this translation helpful? Give feedback.
-
Nice! I'll give that a try but it sounds like exactly what I need... Thank you so much! |
Beta Was this translation helpful? Give feedback.
Use auto imports: https://github.com/antfu/unplugin-auto-import
Nuxt has it by default