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

Document not getting deleted in firestore

I'm using Vuex form my state management in my web app. I wanted to delete a document from my firestore database but when I click the button nothing happens. This is segement of the card header with a delete icon so when clicked it deletes the…
2
votes
1 answer

Access $root instance from vuex actions

I have a Loader component in which it will execute based on created() { this.$root.$on('show-loading', (vars) => { this.loading = vars; console.log('loader executed'); }); }, Currently from a vue component i can execute…
Dexter Siah
  • 273
  • 2
  • 6
  • 17
2
votes
2 answers

Setting values in a Vue.js form using jQuery

I have a huge form that's on an external website (no control over source code) that's been created with Vue.js. I'm trying to bulk update this form by using the console. When I try to change the values of the field using jQuery with something…
SkyMan
  • 23
  • 4
2
votes
1 answer

Change state using Mutation VueJS?

So i have a Vuex Store setup which returns me headers and desserts. Inside my desserts i have a property setup named display which is initially false. I have a component Row which i am importing inside my parent component named Table. Row Components…
Somethingwhatever
  • 1,390
  • 4
  • 32
  • 58
2
votes
1 answer

(VUE / VUEX) Best practices regarding fetching and parsing data from an API call

I have a question regarding best practices when fetching / parsing data from an API call. Option 1: API call with an adapter on fetch storing the modified data Option 2: Always store raw data from API call and rely on getters for adaptation Notes:…
Peter
  • 69
  • 5
2
votes
1 answer

Using mapState and mapMutations from a namespaced module

I can't figure out how to access mutations and states after having split my vuex store into three modules. I've tried different syntaxes and I'm not sure what to follow. MapStates: This is how I've set up the mapStates, vendor and root are the…
2
votes
1 answer

How to mock $nuxt object in vue-test-utils and jest

I am using vue-test-utils and jest in order to test my code. My test run without any problem except if it pass through the code below $nuxt.$store.commit("device/saveState", { id: this.$.id, key: this.$.ac_key, power:…
Johji
  • 240
  • 1
  • 19
2
votes
1 answer

Vuex Getter Undefined

I am new to Vue.js and experiencing an issue with Vuex modules and Axios. I have a "post" component that retrieves a slug from the router and fetches data with Axios which is then retrieved with Vuex Getters. I am able to retrieve data successfully…
0x0
  • 363
  • 1
  • 4
  • 19
2
votes
1 answer

How to test namespaced mapAction in Vue

I have a namespaced Vuex store in my Vue 2.6 app one module of which is like this: //books.js export default { state: { books: null }, mutations: { SET_BOOKS(state, books) { state.books = books; }, }, actions: { …
r_zelazny
  • 517
  • 3
  • 19
2
votes
1 answer

How to bind to element?

Vuex.Store({ state: { percentage: 0, }, ... I want to do but I'm getting error 'v-model' directives aren't supported on elements. How to do it otherwise? I would like to…
naglas
  • 462
  • 1
  • 6
  • 16
2
votes
0 answers

using vuex to generate chartjs chart problem

I am a beginner in Vue and I want to create a project that uses Chart.js. I am using Vuex and am having a trouble to generate the data into the component.