index.js 535 B

12345678910111213141516171819202122232425
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. import alert from './modules/alert'
  4. import adminUsersCreate from './modules/admin-users-create'
  5. Vue.use(Vuex)
  6. export default new Vuex.Store({
  7. state: {
  8. loading: false
  9. },
  10. mutations: {
  11. loadingChange: (state, loadingState) => { state.loading = loadingState }
  12. },
  13. actions: {
  14. startLoading({ commit }) { commit('loadingChange', true) },
  15. stopLoading({ commit }) { commit('loadingChange', false) }
  16. },
  17. getters: {},
  18. modules: {
  19. alert,
  20. adminUsersCreate
  21. }
  22. })