store.js 397 B

1234567891011121314151617181920212223242526
  1. import Vue from 'vue'
  2. import Vuex from '../../../src'
  3. import mutations from './mutations'
  4. Vue.use(Vuex)
  5. const state = {
  6. count: 0,
  7. history: []
  8. }
  9. const store = new Vuex.Store({
  10. state,
  11. mutations
  12. })
  13. if (module.hot) {
  14. module.hot.accept(['./mutations'], () => {
  15. const mutations = require('./mutations').default
  16. store.hotUpdate({
  17. mutations
  18. })
  19. })
  20. }
  21. export default store