const state = {
  leftMenuWidth: '200px',
  isCollapse: false
}

const mutations = {
  CHANGE_COLLAPSE: (state) => {
    state.isCollapse = !state.isCollapse
    if (state.isCollapse) {
      state.leftMenuWidth = 'auto'
    } else {
      state.leftMenuWidth = '200px'
    }
  }
}

const actions = {
  changeCollapse (context) {
    context.commit('CHANGE_COLLAPSE')
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
