Каркас будущего приложения
This commit is contained in:
15
client/store/index.js
Normal file
15
client/store/index.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { createStore } from 'vuex';
|
||||
import VuexPersistence from 'vuex-persist';
|
||||
|
||||
import root from './root.js';
|
||||
|
||||
const debug = process.env.NODE_ENV !== 'production';
|
||||
|
||||
const vuexLocal = new VuexPersistence();
|
||||
|
||||
export default createStore(Object.assign({}, root, {
|
||||
modules: {
|
||||
},
|
||||
strict: debug,
|
||||
plugins: [vuexLocal.plugin]
|
||||
}));
|
||||
25
client/store/root.js
Normal file
25
client/store/root.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// initial state
|
||||
const state = {
|
||||
apiError: null,
|
||||
};
|
||||
|
||||
// getters
|
||||
const getters = {};
|
||||
|
||||
// actions
|
||||
const actions = {};
|
||||
|
||||
// mutations
|
||||
const mutations = {
|
||||
setApiError(state, value) {
|
||||
state.apiError = value;
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
getters,
|
||||
actions,
|
||||
mutations
|
||||
};
|
||||
Reference in New Issue
Block a user