import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'
import baozheng from './modules/baozheng'
import getters from './getters'

Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    user,
    baozheng
  },
  getters
})
store.watch(
    (state) => state.user.chatlist,
    (val) => {
        localStorage.setItem('vue-chat', JSON.stringify(val));
    },
    {
        deep: true
    }
)
export default store