Questions tagged [vuex]

Vuex is a state management pattern + library for Vue.js applications. It serves as a centralized store for all the components in an application, with rules ensuring that the state can only be mutated in a predictable fashion.

Vuex is a data management library by the creator of Vue.js. It is designed to help build larger applications in a more maintainable way by following principles similar to those made popular by Facebook’s Flux library (and subsequent iterations by community like redux).

Principles

  • Terse
  • Testable
  • Reactive
  • Single State Tree
  • Hot Reloading
  • Time Travel (with vue-devtools support)

GitHub: https://github.com/vuejs/vuex Documentation: https://vuex.vuejs.org/en/

7756 questions
2
votes
1 answer

how to handle nested objects in vuex-orm

i have this object: userRights { "admin": true, "rights": [ { "id": 1, "value": true }, { "id": 2, "value": true }, { "id": 3, "value": true }, { "id": 4, "value": true …
Deniz
  • 1,435
  • 14
  • 29
2
votes
2 answers

How to get intellisense of mapGetters, mapActions Vuex and typescript without class-style or decorators syntax

I use Vue.js and Vuex for some time, but always with javascript. I'm trying to use Vue with Typescript, nuxt.js to be more specifically, but without using decorators or style-class-component, only continue with the normal Vue syntax This is the code…
Yung Silva
  • 1,324
  • 4
  • 20
  • 40
2
votes
0 answers

Vuex store reference Vuetify - "TypeError: Cannot read property 'theme' of undefined"

I would like to change the prop of vuetify from the vuex store. From a component I can do this.$vuetify.theme.dark = true;. This is not possible in the store but unfortunately I get the same error when trying it like…
NotARobot
  • 455
  • 2
  • 10
  • 27
2
votes
2 answers

Bind a VueX store state value to an input (VueJS)

I'm new with VueJS, and I'm creating a VueJS app where you can get some informations about a Github User, (example: https://api.github.com/users/versifiction) I created a store with VueX, but I need to update the value written by the user in the…
VersifiXion
  • 2,152
  • 5
  • 22
  • 40
2
votes
1 answer

Typescript error "Unable to resolve signature of class decorator when called as an expression" in Vuex module

I have the following Vuex module using Typescript that I'm exporting from a library: import * as types from '@/store/types'; import {Formio} from 'formiojs'; import { VuexModule, Module, Mutation, Action } from 'vuex-module-decorators' interface…
wonder95
  • 3,825
  • 8
  • 45
  • 74
2
votes
1 answer

Getting updated value of state in a javascript file in Vue Js

I am trying to update state variable's value from a vue file and I want that updated value in a javascript file. I am updating value using mutations from vue file but when I retrieve value inside of javascript file it is showing state variable's old…
Aryesh
  • 386
  • 2
  • 16
2
votes
1 answer

How can i send object data from vue component to vuex store?

Note: This is a fake project with fake datas. Unimportant setting up the token with Date.now() My Question: I want to send userData object to vuex store. I want to send the userData object to the Vuex repository. But its return [object object]. I…
Emre Arabaci
  • 408
  • 1
  • 6
  • 9
2
votes
1 answer

Shouldn't Nuxt update Vuex state before rendering and returning a page?

Need some clarity regarding Vuex and SSR here. Don't know what concept I'm not getting right since this is my first time working with SSR. I'm trying to create breadcrumbs for my application using the store. The concept is that the parent component…
Theo
  • 465
  • 3
  • 15
2
votes
1 answer

Vuex in vue .net core application

I have an ASP .NET Core project with a Vue front end. This was made using: dotnet new — install Microsoft.AspNetCore.SpaTemplates::* dotnet new vue This builds and runs fine but when I try and add vuex for state management I get a list of…
GrahamJRoy
  • 1,603
  • 5
  • 26
  • 56
2
votes
4 answers

change input text value vuex

I get this error in my console when I try to change the text of an input text of my components: [vuex] do not mutate vuex store state outside mutation handlers I also use nuxt with vuex. I have this in my store: editor.js export const state = ()…
Marc Taulé
  • 115
  • 4
2
votes
1 answer

vuex: unknown getter: articles

I try to implement vuex modules and understand usage. While trying to import modules in my home.vue, I have found this solution: import { FETCH_INDEX_ARTICLES } from "@/store/types/actions.type.js"; // imports this => export const…
ytsejam
  • 3,291
  • 7
  • 39
  • 69
2
votes
3 answers

Vuex mapState returns object not array?

I want to loop over an array of objects using v-for. However my state returns an object containing an array of Objects: { "todos": [ { "id": "x", "description": "y" }, { "id": "a", "description": "b" } ] } which causes v-for not to work. If I use…
Rugo
  • 349
  • 1
  • 6
  • 14
2
votes
1 answer

Can't access Vuex Module Getter - Cannot read property 'getters' of undefined"

I can't access a stores getter for some reason. File structure: /store/index.js /store/modules/auth.js store/index.js import Vuex from 'vuex'; import Vue from 'vue'; import auth from './modules/auth'; Vue.use(Vuex); export default new…
Half_Duplex
  • 5,102
  • 5
  • 42
  • 58
2
votes
1 answer

Video.js with Vue.js (MPEG-DASH) ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED)

I have problem with Video.js with i use it as component in vue.js. I recieve a .mpd link from a Server and i want to show the video from the link, i did like the example in documentation Video.js and Vue integration. always the first time i call…
El-Hani
  • 163
  • 9
2
votes
1 answer

Testing a vue app with nuxt, vuex and jest gettig not supported error

I want to Unit test my component which mutates an object in a store module when a button is clicked. I followed the article by brandon aaskov on how to unit test nuxt plus vuex, but I'm not able to reference the nuxt store Object. I always get an…
alexcodes
  • 404
  • 3
  • 11