wikijs-fork/client/js/store/index.js

53 lines
1.5 KiB
JavaScript
Raw Normal View History

import Vue from 'vue'
import Vuex from 'vuex'
2017-05-22 17:32:52 +00:00
import anchor from './modules/anchor'
import editor from './modules/editor'
import editorCodeblock from './modules/editor-codeblock'
import editorFile from './modules/editor-file'
import editorVideo from './modules/editor-video'
import modalCreatePage from './modules/modal-create-page'
import modalCreateUser from './modules/modal-create-user'
import modalDeleteUser from './modules/modal-delete-user'
2017-10-10 01:43:43 +00:00
import modalDeletePage from './modules/modal-delete-page'
import modalDiscardPage from './modules/modal-discard-page'
import modalMovePage from './modules/modal-move-page'
2017-06-12 01:11:01 +00:00
import modalProfile2fa from './modules/modal-profile-2fa'
import modalUpgradeSystem from './modules/modal-upgrade-system'
import navigator from './modules/navigator'
import pageLoader from './modules/page-loader'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
loading: false
},
mutations: {
loadingChange: (state, loadingState) => { state.loading = loadingState }
},
actions: {
alert({ dispatch }, opts) { dispatch('navigator/alert', opts) },
startLoading({ commit }) { commit('loadingChange', true) },
stopLoading({ commit }) { commit('loadingChange', false) }
},
getters: {},
modules: {
2017-05-22 17:32:52 +00:00
anchor,
editor,
editorCodeblock,
editorFile,
editorVideo,
modalCreatePage,
modalCreateUser,
2017-10-10 01:43:43 +00:00
modalDeletePage,
modalDeleteUser,
modalDiscardPage,
modalMovePage,
2017-06-12 01:11:01 +00:00
modalProfile2fa,
modalUpgradeSystem,
navigator,
pageLoader
}
})