/store/modules/mobile.js
export default {
state: {
names: []
},
mutations: {
setKeystore (state, name) {
state.names.push(name)
},
/store/index.js
getters: {
identities => ()=> names
Once the mutation in the module has been triggered, the getter identities
will be invoked. At that moment, the identities getter returns an empty array. However, when trying to access it using Vue dev tools as $vm0.$store.$state.mobile.names
, a non-empty array can be found.
Am I overlooking something important in the JavaScript code? If not, how can I retrieve the module's state inside the getter in index.js?