import Cookies from 'js-cookie'; const state = { layerTree: [], defaultLayer: [], }; const mutations = { CHANGE_LAYERTREE: (state, res) => { state.layerTree = res; }, CHANGE_DEFAULTLAYER: (state,res) => { state.defaultLayer = res; }, }; const actions = { changeLayerTree({ commit }, obj) { commit('CHANGE_LAYERTREE', obj); }, changeDefaultLayer({ commit }, obj) { commit('CHANGE_DEFAULTLAYER', obj); }, }; export default { namespaced: true, state, mutations, actions, };