pinia Questions
3
Solved
I'm currently working on my first vue application, currently building the login logics.
For State management, pinia is being used. I created a Pinia Store to manage the "isLoggedIn" state...
Nephritic asked 30/3, 2022 at 11:7
2
I have a pinia store that has a user object..
export const useStore = defineStore('store', {
state: () => ({
currentSlide: 1,
user: {},
data,
}),
})
I am then updating it to have a an arra...
Sanalda asked 21/7, 2022 at 9:27
4
Solved
I am trying to set up Nuxt3 to work with Pinia.
Steps Taken:
Started with an active nuxt3 project
ran npm install @pinia/nuxt
this failed, with a dependency error, so re-ran with npm install @pini...
5
Solved
I'm trying to do a JWT authentication to a distinct API.
As @nuxtjs/auth-next doesn't seem to be up to date and as I read it was possible to use the new global method fetch in Nuxt 3 instead of @nu...
Radloff asked 18/8, 2022 at 6:54
4
Solved
Is there a way to call Pinia store action from another action in the same store? For example, I have Pinia store like this:
export const useCounter = defineStore({
id: 'counter',
state: () =>...
1
Solved
Pinia/Vuex
Pinia/Vuex, as well as Redux, are designed to be a "single source of truth", where you have a store or multiple stores that hold the application data, available from eve...
4
Solved
I'm trying to understand the purpose of composables. I have a simple composable like this and was trying to watch state from a Pinia store where the watch does not trigger:
import { ref, watch, com...
Escorial asked 9/4, 2022 at 17:50
3
Solved
I have a couple of Pinia stores that should share a set of actions and getters and I’m not quite sure how to effectively achieve that.
I’m building an app that lets users manage a number of differe...
Jojo asked 5/11, 2022 at 20:10
2
Solved
I'm trying to create an Vue 3 with app with JWT authentication and meet an issue with guarding the router using "isAuth" variable from Pinia store to check the access. Eventually Vue rout...
Etoile asked 31/3, 2022 at 18:23
2
I work on a project that leans on an app-level provide for global state management. At first, the provided object was small, but it has grown with the project.
How much does app performance suffer ...
Coke asked 20/10, 2022 at 13:11
1
I'm using pinia and I would like to know, how to update a property inside an object. I have an array of objects inside the state.cart, which are some products, which all have a property called quan...
Killick asked 22/6, 2022 at 9:31
2
Does anyone know if it's possible to subscribe to a specific action in Pinia?
I know there's a way to subscribe to all actions like this:
const subscribe = someStore.$onAction(callback, false)
But...
1
Solved
I would like to know what is the current route so that I can compute the size of the sidebar.
import { defineStore } from 'pinia'
export const useSidebarStore = defineStore('sidebar', {
state: ()...
2
Solved
I have a pinia store created with setup syntax like:
defineStore('id', () => {
const counter = ref(0)
return { counter }
})
Everything has been working great with setup syntax because I can...
1
I've been trying to get my Pinia store up and running in Vue 3 and it all has been pretty effortless until I wanted to access some parameters in the url.
I have a store (simplified) like so:
import...
Habitable asked 14/12, 2022 at 9:0
0
I'm using Nuxt3 in combination of Pinia. In pinia I have a function to authorize a user like:
async login (credentials: User) {
var requestOptions = {
method: 'POST',
body: {
email: '[email&#...
1
I am wanting to use Nuxt3. From my understanding, it uses universal rendering, which is like a cross between CSR and SSR. I have a few questions, however, before I get started.
How does Nuxt3 dete...
0
I have a Vue3 application for which I want to convey a specific type of UX where changes made to a resource are automatically saved (i.e. no save button). The application has several different type...
Schoolhouse asked 29/11, 2022 at 23:16
2
Solved
I have a design in setting page,every one of them hava reset button, now i using pinia to be store library.
I kown $reset is reset the whole pinia state,so,how to reset one of data in pinia state?
...
6
Solved
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 useStore = defineStore("game", {
...
Moseley asked 4/11, 2021 at 1:34
2
I'm implementing a auth store(with firebase) and depending on the auth I want to route my user to login/logged page.
I'm basically trying to accomplish this: https://github.com/dannyconnell/vue-com...
Amine asked 1/10, 2022 at 9:26
3
Solved
I'm building a Vue 3 app using the OptionsAPI along with a Pinia Store but I frequently run into an issue stating that I'm trying to access the store before createPinia() is called.
I've been follo...
Snazzy asked 17/2, 2022 at 18:57
1
Solved
When I try to modify my store in the router I have this error:
"TypeError: 'set' on proxy: trap returned falsish for property 'transitionName'"
store transition:
import { defineStore } fr...
Mckeever asked 5/10, 2022 at 20:45
4
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 is created in localstorage. I feel li...
1
Solved
I'm using Vue 3.2 <script setup>, If I try to acess Pinia's store inside an API Service It throws the following error;
Uncaught ReferenceError: Cannot access 'store' before initialization at ...
Megara asked 20/9, 2022 at 18:49
© 2022 - 2024 — McMap. All rights reserved.