tabActive.js
375 Bytes
const state = {
tabActiveMap: new Map(),
}
const actions = {
setTabActive({ commit }, {tabName, activeIndex}) {
commit('setTabActive', {tabName, activeIndex})
}
}
const mutations = {
setTabActive(state, {tabName, activeIndex}) {
state.tabActiveMap.set(tabName, activeIndex)
},
}
export default {
namespaced: true,
state,
actions,
mutations,
}