Skip to content

Can I use Pinia without installing it? #1085

Closed Answered by posva
3zzy asked this question in Help and Questions
Discussion options

You must be logged in to vote

You could technically do setActivePinia(createPinia()). Pinia Plugins require an app instance to be effective, so you might need to write to pinia._a a fake app and make sure to do it before any call to pinia.use().

Note that if you are shipping components that use Pinia, you should consider using provide/inject instead. If you still want to use pinia, users of your components should install the pinia instance themselves if they are building a Vue application.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@mrcego
Comment options

@capynet
Comment options

@mrcego
Comment options

@johnwc
Comment options

@mrcego
Comment options

Answer selected by posva
Comment options

You must be logged in to vote
1 reply
@websilone
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants