Questions tagged [vuex-modules]

Use this tag for Vuex questions in which the store is subdivided into Vuex modules.

As a Vuex application grows in scale, the store and state tree can get increasingly bloated.

To help with that, Vuex allows us to divide our store into modules. Each module can contain its own state, mutations, actions, getters, and even nested modules.

By default, actions, mutations and getters inside modules are still registered under the global namespace - this allows multiple modules to react to the same mutation/action type.

Read more in the Modules section of Vuex's official website

327 questions
0
votes
2 answers

VueX Getter acting reactively - how to assign non-reactive to variable?

I am running into a bit of a quirk that I can't seem to wrap my head around and don't know if this is the standard behavior of VueX or if I'm implementing this incorrectly. I have a VueX getter on a modular store that I am assigning to a new…
radiantstatic
  • 342
  • 4
  • 20
0
votes
1 answer

Vuex update view on commit

I'm new on Vuex js and everything about stores. I've got the following store.js import Vuex from 'vuex' import Vue from 'vue' import axios from 'axios'; Vue.use(Vuex) export const store = new Vuex.Store({ state: { pacientes:…
AtarC5
  • 393
  • 2
  • 11
  • 27
0
votes
2 answers

Error in render Vuex

I am currently setting up a project with Vuex and Vue, but am encountering an odd issue. I am speculating that it has to do with the order of render, but after several attempts to alter the code to no avail, I am still not sure. What I tried is to…
Alete
  • 49
  • 5
0
votes
0 answers

Vuex module breaks on getters declaration part

The Vuex store was starting to get a bit crowded so I decided to break it into modules. However, the code breaks after compiling with the following error Uncaught TypeError: Cannot read property 'customS' of null This is my invitations…
0
votes
1 answer

Vuex store, why adding to array overwrites all values in store with last entry?

I am using vuex-typescript. This is one store module: import { getStoreAccessors } from "vuex-typescript"; import Vue from "vue"; import store from "../../store"; import { ActionContext } from "vuex"; class State { history: Array; } const…
pregmatch
  • 2,629
  • 6
  • 31
  • 68
0
votes
1 answer

How to use it correctly Vuex store?

So I'm currently facing logical problem problem on how to store data in Vuex.
user1692333
  • 2,461
  • 5
  • 32
  • 64
0
votes
1 answer

get single record through axios in vuex store

I would like to return a single record from my back end using a Vuex store module in Nuxt. I have the following in my component, which passes the value i want ( which is the $route.params.caseId ) created () { …
Paul
  • 581
  • 3
  • 10
  • 19
0
votes
1 answer

Pass a state of vuex to a chart - vue

I'm doing a chart component that will be several times represented on a page. For that, I'm using Vuex where I have the mutations / actions to get that date, and everything works fine. In the graph component, in created () I call the action to make…
martinho
  • 1,006
  • 1
  • 10
  • 24
0
votes
0 answers

Unable to call vuex namespaced module action from Vue component

I have a Vue component that uses Vuex with namespaced modules. // Main Component import store from './store'; import {mapState, mapGetters, mapActions} from 'vuex'; new Vue({ store, computed: { ...mapState({ showModal: state =>…
Andy
  • 2,493
  • 6
  • 37
  • 63
0
votes
1 answer

Vuex-map-fields updating multiple stores through modules

I'm working Vuex modules to state my data. I store the data in multiple modules to keep my code base nice and clean. When using vuex-map-fields I have a situation where I'm using data from multiple modules. There seems to be no method to do this or…
user3663901
  • 1
  • 1
  • 3
0
votes
0 answers

How to call ajax only when show detail on vue component?

I have two component. I set and get data by vuex store My first component like this :