
// Vuex状态树
const state = {
  device: 'desktop'
}

const mutations = {
  // 切换设备
  TOGGLE_DEVICE: (state, device) => {
    state.device = device
  }
}

const actions = {
  // 切换设备
  toggleDevice({ commit }, device) {
    commit('TOGGLE_DEVICE', device)
  }
}

export default {
  namespaced: true, // 解决不同模块命名冲突的问题
  state,
  mutations,
  actions
}
