Questions tagged [vuex]

Vuex is a Flux-inspired Application Architecture for Vue.js.

0
votes
1answer
18 views

Mutation is not set value no state - Vuex

Mutation is not set value no state. The problem is that the state is not being updated. What I'm doing wrong. Mutation function cardValidationSet (state, data) { state.cardValided = data } ...
0
votes
1answer
17 views

How to pass values ​from display to mutatuion - Vue?

How to pass values ​from display to mutatuion - Vue? he return is an error indicating that the function does not exist. Where can I be wrong? Thank you guys import Vue from 'vue' import Vuex from '...
0
votes
0answers
11 views

Control Navigation drawer in Vuex

I have split out my toolbar and navigation drawer into separate components and using vuex to control the drawerState in mobile mode, the hamburger icon opens and closes the nav drawer fine, but in ...
0
votes
1answer
23 views

How to use createPersistedState in a vuex and quasar application?

How to use createPersistedState in a vuex and quasar application? I am trying to persist some daos in the cookie of my application, however the data is not being written in the cookie. What am I ...
0
votes
1answer
18 views

Unwanted Vuex store state mutation triggered

I have a mixin for my view components that I use to set the metadata for each page. I'm using Vuex to fetch the default metadata in my store. When including the mixin in each component, I add the "...
2
votes
0answers
27 views

How to handle navigation when removing the current page's Vuex record?

I have a ClientManagePage where I display client information and allow for the removal of the displayed client. The vue-router route configuration for that page looks like this: { path: '/client/:...
1
vote
1answer
17 views

Store multiple images with Vuex and FIrebase [duplicate]

I have a working solution to upload multiple images, but I think there is room for improvements. This is my current code: (sorry for some norwegian variables). Vue methods: methods: { onCreateTool ()...
0
votes
0answers
35 views

Vue/Vuex watcher dynamic/async component loading

I have a base component within which I have a dynamic component with a v-for that displays based on a computed property. All I've really tried doing thus far, which was an incorrect methodology, was ...
0
votes
1answer
16 views

How to change global variable in the store file in vue from a vue component

I'm taking over a project and this project has a global variable defined in one of the store modules. My goal is to modify the value of this variable by creating an check boxed input area in one of my ...
0
votes
0answers
14 views

Update Vuex only if data is new (different from existing)

I use vuex store in my application to store news items from feed. Idea is that if user will navigate to other page and come back on the feed page, posts from store should be visible and loading new ...
0
votes
0answers
26 views

How to transfer value from Vuex Store to i18n.js?

I am trying to make the language that I chose was saved when the program was restarted. How to save the value of locale:'' in i18n when switching languages? I want to transfer this value from VUEX ...
1
vote
1answer
34 views

Vuex state is null in mutation after page refresh instead predefined object

In a simple application, I create a simple set of mutations and actions that are tied to the component creation hook. In browser, after pressing F5, when vue-devtools opened on Vuex tab I get an error ...
0
votes
1answer
23 views

How to set state from an external API in Vuex store

In my store.js I init an object let exchangeRates = { GBPtoUSD: 0, // American dollar GBPtoEUR: 0, // Euro GBPtoCAD: 0, // Canadian dollar GBPtoINR: 0, // Indian rupee GBPtoCHF: 0 ...
0
votes
1answer
18 views

Is case-insensitive comparison of string possible for 'where' clause in vuex ORM?

While filtering data from the store, I need to check whether 'name' field of the data is 'stackoverflow'. So I use: data() { myname: 'stackoverflow' }, computed: { user() { return this.$store....
2
votes
0answers
20 views

using mock data while on development with vue + vuex

I'm working on a Vue app which also uses vuex. Everything is setup ad working correctly as expected but i'd like to improve it so that I can work on it without actually calling the API endpoints (...
1
vote
1answer
28 views

Fetch only once data from twitch API

I need to do 3 request to the twitch API (grap the info about the live, about the streamer and the game). I can't to it one shot because the data from the live is not already available for fetch the ...
0
votes
1answer
19 views

How do I use Vuex State data in methods

With the following code <template> <div :id="svgId" class="svg-container"></div> </template> <script> import { mapState } from 'vuex' export default { name: 'Space',...
0
votes
1answer
20 views

Show navbar menu depends on user authentication

I have a fixed navbar component in different views. This navbar contain Login link which redirect to login page. After the user enter his correct credentials I redirect him to home page which ...
0
votes
1answer
17 views

Vuex: Why array in state is mutated (possibly via a computed property) even though not committed / dispatched

The following code is a very simple app. The App mounts, receives list of quotes via (firebase's) value event from a ref/endpoint, pushes to allQuotes array in home.vue. Then in QuoteList.vue, just ...
1
vote
1answer
32 views

Vuex and Firebase, store additional user info

I have a function where i'm creating a user with Firebase and Vuex, and want to store some additional information about the user. When I create a user, I run the code below, where payload contains ...
0
votes
0answers
54 views

Vue: how to apply multiple global mixins

I am currently working on a Vue project including multiple applications. It has project-wide used methods and application-wide used methods. Therefore, I created 2 mixins which need to be available ...
1
vote
0answers
18 views

Waiting request located in middleware finished before rendering page

I have an issue here. I use Vue.js alongside with Nuxt.js. I made middleware to implement the authentication. Here I use JSON Web Token. I have accessKey and refreshKey. The refreshKey is used to ...
0
votes
0answers
19 views

Firebase trying to return onAuthStateChanged

Trying to implement firebase authentication, the login, sign in, logout are working so trying to return if user is logged in or not. The userID from my store is returning as undefined/not updating ...
1
vote
1answer
35 views

Will vuex work properly with generic mutations that don't reference `state`?

I’m using vuex with a tree of data. It's reactive and works well because we have a corresponding tree of components. Since the structure is a tree, it’s common to want to mutate a deeply nested child ...
0
votes
1answer
16 views

Vuetify datepicker year only max date doesn't trigger vuex state mutation

I have written a small example where I try to update a vuex state for year, by triggering the relevant vuex mutation by selecting the year via a vuetify date-picker (year only). It works quite well ...
0
votes
1answer
41 views

How do I use Vue.set() properly?

I am trying to make an array within my store reactive. I have currently tried using :key to force update, $forceUpdate() and Vue.set(). I originally was getting and updating the data within the ...
0
votes
2answers
49 views

Vuex getter does not return current state value

I have an object inside the Vuex state with certain server details. The state, mutation and getter look like this: // Code inside store/index.js of the nuxt application const state = () => ({ ...
0
votes
0answers
44 views

what is difference between watch and computed? [on hold]

How can I use data-bind to computed properties in templates? Instead of a computed property, we can define the same function as a method instead. For the end result, the two approaches are indeed ...
0
votes
0answers
29 views

Is there a better way to get user from database after authenticating user with Firebase Auth? [duplicate]

Using Firebase Auth (with REST) and have a separate firebase database for additional user information that cannot be stored in auth. I need to set the state to the current user after signup or login. ...
0
votes
0answers
18 views

Login user, validate with passport.js, then get user data to frontend with axios

I'm trying to get the data from a user after he logs in, from my front end I submit the username and password and it succesfully sends the data to the server and passport success redirects to my ...
0
votes
0answers
33 views

Can't get the state in Vuex getters and mutations after page reload

I'm using vue-cli@3 and vuex@3.0.1. First step: I open the URL and the website is working. Second step: I refresh the website, then errors are thrown. So I can't get the data in store's getters by ...
0
votes
1answer
22 views

Vuex state not updating, state.dispatch no being called

I am using Vue and a Vuex store in a project. Here's the Vuex store export default new Vuex.Store({ state: { inventoryPageNumber: 0, inventoryPageCount: 0, }, getters: { ...
0
votes
1answer
57 views

What is the best practice for reactive setter for an object in array in Vuex?

I have a vuex object with array of languages that has objects with guid, name and level. How can I write method so that it will make it reactive. I got to the point where I have input field with ...
0
votes
2answers
28 views

vuex unknown action (or mutation) type

I'm writing a simple code to set token in store in an Nuxt application. when I tried to call a mutation or action from my store, this error is logged in console: [vuex] unknown action type: setToken ...
0
votes
1answer
25 views

How to update profile/user data in auth state in Vuex with Nuxt Auth Module?

Short Question: Is it possible to update the user data in Vuex manually via the Nuxt Auth Module? Why do I have that Question: My problem is this. I save some Likes/Follows in MongoDB in the user ...
0
votes
1answer
30 views

Can`t get specific data from vuex in components

I can get all data from vuex except only one and what surprise me more is I can get data in Chrome, only in Chrome. Already tried different approaches, switch between localstorage and vuex-...
0
votes
1answer
25 views

Vue get the current element and read children

I'm new to Vue and I have a bootstrap navigation with a collapse which contains more navigation items. So basically it's just a menu which can slide in and out. What I want: I want to add a class to ...
0
votes
0answers
22 views

Using Constants for Mutation Types with Nuxt

Consider the approach of using constants for mutation types on the Vuex Store that can be seen on this link Mutation Types - Vuex Store In my project, I've already used such type organization, but I'...
0
votes
1answer
26 views

What is the practice for handling Vuex action outcomes

I'm creating a login system using Vue and Vuex following this guide https://scotch.io/tutorials/handling-authentication-in-vue-using-vuex#toc-setup-components This have the login action return a ...
0
votes
3answers
40 views

Vuex can't update component after mutation

I'm trying to update a component after i pushed something new into my array. I create a post in createPost.vue and commit it into my store.js file where it store the object that i send into the state. ...
0
votes
1answer
36 views

Cannot pass multiple arguments in vuex actions

I'm trying to call vuex action in vue component with multiple parameters. But in action method cannot access these passed arguments. I have already tried passing value in payload as object which is ...
0
votes
1answer
32 views

Implement a pop up box after a successful axios post

I have an action storeExpense(context, params){ axios.post('api/expenses', params) .then( response => { context.dispatch('getExpenses') }) .catch( error => { ...
0
votes
0answers
15 views

How to serve 2 vue apps under same domain in nginx?

I've tried to get this nginx config to work, and it works. But not the way I intend it to work. Currently I'm serving logima.io through static files from production build. I wanted to integrate a vue ...
0
votes
0answers
36 views

Why am I getting the default vuex store values and not the updated ones for my computed property?

I have an initial (starting) page where the user can press a button to login. Also when in that page I want to know if the user's already logged in or not, so I'm using mapState to access the ...
1
vote
0answers
23 views

Why “state Vuex” is not saved after “dispatch action” in middleware

I load cookie "darkMode" to Vuex in middleware Store index.js import * as mut from './mutation-map' export const state = () => ({ darkMode: false }) export const getters = ...
0
votes
0answers
24 views

How do I to read and parse a cookie and store the results in Vuex prior to running Vue-Router guards

I'm currently using the method described in Authentication in SPA the Right Way wherein a JWT header and payload is stored inside a session cookie. I want to read this cookie, if available, as soon ...
0
votes
0answers
32 views

Vuex ORM entity data is always empty?

I'm working to implement Vuex ORM to normalize my data. I come from a Rails background so working with an ORM seems to be a much easier way to handle deeply nested data to me also. I've followed the ...
0
votes
2answers
44 views

Problem importing getters into Router - Vuex

Problem importing getters into Rotate - Vuex. I am trying to import a value that is within the vuex state. An error is reported, stating that it is undefined. I have no idea what I might have done ...
0
votes
1answer
16 views

Fetch cached data Vue CLI Vuex PWA

How do I get my cached data from service worker in to the vuex store in offline mode? The app works in offline mode in the browser, but when I add the site to home screen with the manifest.json file ...
1
vote
1answer
26 views

how to add Firebase to a Vuex todo list app?

I am building a simple Vue.js todo list app using Vue.js, Vuex, and Firebase. The Vuex store dispatches, commits, and returns the inputted data just as it should, but I want to be able to connect the ...

http://mssss.yulina-kosm.ru