import Vue from 'vue'
import Vuex from 'vuex'
import router from '../router'
import baseInfo from './modules/baseInfo'
import userInfo from './modules/userInfo'
import storage from './modules/storage'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    textIsEdit: false,
    questionEdit: false,
  },
  mutations: {
    ToLogin() {
      router.push({
        name: 'login'
      })
    },
    changeTextIsEdit(state, val) {
      state.textIsEdit = val
    },
    changeQuestionEdit(state, val) {
      state.questionEdit = val
    },
  },
  actions: {
  },
  modules: {
    baseInfo,
    storage,
    userInfo
  }
})
