[Vuejs]-Mutate vuex store property from modules

0👍

A better approach would be to have a single mutate function in your primary moudle (which containes the array) along with an action which is called to commit the mutation. Then, you can call this action from any other module you wish to using

dispatch(your_base_action, {args}, { root: true })

To access your array from any other module, you can use rootState, like so-

rootState.base_arr

Leave a comment