I've a module named "csv", to handle csv files, and a vue-tables-2 with vuex
:
Store structure:
-store
-modules
-csv.js
-index.js
index.js:
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
commons,
ldap,
csv <---- I want to execute the mutation in this module
},
mutations: {
["csvTable/ROW_CLICK"](state, data){
<---- but now it's running here
},
}
})
csv.js
// initial state
const state = {
//...
}
// getters
const getters = {
//...
}
// mutations
const mutations = {
["csvTable/ROW_CLICK"](state, data){
< ---I want to execute the mutation here
}
}
export default {
//...
}
So I want to know how can I execute the ROW_CLICK mutation in the csv module.
I thought I could do it like this:
index.js:
["csvTable/ROW_CLICK"](state, data){
this.commit(csv/ROW_CLICK, data);
},
But I do not think it's the best way to do it.
Thank you.