| 1 |
import Vue from 'vue'; |
| 2 |
import Vuex from 'vuex'; |
| 3 |
import createLogger from 'vuex/dist/logger'; |
| 4 |
|
| 5 |
Vue.use(Vuex); |
| 6 |
|
| 7 |
const debug = process.env.NODE_ENV !== 'production'; |
| 8 |
|
| 9 |
import mutations from './mutations' |
| 10 |
import actions from './actions' |
| 11 |
|
| 12 |
export default new Vuex.Store({ |
| 13 |
state: { |
| 14 |
fieldMode: 'add', |
| 15 |
sidebarLoading: true, |
| 16 |
editorShortcodes: {} |
| 17 |
}, |
| 18 |
getters: { |
| 19 |
fieldMode: state => state.fieldMode, |
| 20 |
sidebarLoading: state => state.sidebarLoading, |
| 21 |
editorShortcodes: state => state.editorShortcodes, |
| 22 |
}, |
| 23 |
actions, |
| 24 |
mutations, |
| 25 |
// strict: debug, |
| 26 |
// plugins: debug ? [createLogger()] : [] |
| 27 |
}); |
| 28 |
|