index.js 278 B

123456789101112131415161718192021
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. Vue.use(Vuex)
  4. const store = new Vuex.Store({
  5. state: {
  6. userInfo: {}
  7. },
  8. mutations: {
  9. userInfo(state, options) {
  10. state.userInfo = {
  11. ...state.userInfo,
  12. ...options
  13. }
  14. }
  15. },
  16. actions: {
  17. }
  18. })
  19. export default store