Category "pinia"

how to call actions from pinia store?

How I can call action from pinia store in vue 3 component? I use composition API. For example, I would like to import 'openLessonCard' - it is action in pinia s

Vue Pinia function is undefined in onMounted when unit test is ran

I have a component and a Pinia store which contains a state and some actions. The code works perfectly fine in browser and in E2E (cypress) tests, but fail on u

How to pass an argument to Pinia store?

I'm making a session API call in main.js and using values from the response as the initial value for my root store. In vuex it's handled this like, DataService.

Nuxt3 + Pinia + VueUse -> useStorage() not working

Setup: I'm using Nuxt3 + Pinia + VueUse. Goal: I want to save a state of a pinia store to localstorage via VueUse: useStorage. Problem: For some reason no item

How can I modify the value of state in pinia in vue3 component test and affect the component?

Using vue-test-utils to test the component using pinia, I need to modify the value of the state stored in pinia, but I have tried many methods to no avail. The

How to set the type for the state object in pinia?

I'm making a chess game and I am using Vue 3 and TypeScript with Pinia for the state management. I want to do something like the following: export const useStor