Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use pinia store ? #5

Closed
rashidpathiyil opened this issue Jan 28, 2022 · 3 comments
Closed

How to use pinia store ? #5

rashidpathiyil opened this issue Jan 28, 2022 · 3 comments

Comments

@rashidpathiyil
Copy link

ACL running before pinia store.

@ahmmismailg
Copy link

Why is this closed? this issue still exists. How to use store in src/acl/index.js ??

@victorybiz
Copy link
Owner

Why is this closed? this issue still exists. How to use store in src/acl/index.js ??

Pinia is supported. Read through the README, you can basically use Pinia or Vuex same way, replace the value of "user" option with the user object from your Pinia store.

@JaxxC
Copy link

JaxxC commented Dec 19, 2023

Pinia is supported, but do not work as described, there are race condition in createApp, and acl almost always lose it, causing error "pinia not defined". So if you need to use it, make next workaround:
create e.g "store/index.ts" file with next content:
import { createPinia, setActivePinia } from "pinia"; const pinia = createPinia(); setActivePinia(pinia); export default pinia;
Then in your main.js file use "import pinia from "./store";" instead "import { createPinia } from "pinia"; const pinia = createPinia();"

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

No branches or pull requests

4 participants