A confusion about using pinia in the Vue project #2187
Unanswered
luffywz
asked this question in
Help and Questions
Replies: 1 comment
-
Hi! The call to the composable This specific example is explained in the Pinia Guide: https://pinia.vuejs.org/core-concepts/outside-component-usage.html |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In my Vue project, I use the permission.js file for permission control
In the main.js
In the stores/index.js
And in the permission.js
It's confusing that if I use 'const userStore=userPinia()' in my permission.js, I will report an error 'getActivePinia was called with no active Pinia.' Did you forget to install pinia? But if I annotate this line of code and use userPinia(), there's no problem
Beta Was this translation helpful? Give feedback.
All reactions