Подключаем работу с Vuex
This commit is contained in:
14
client/store/index.js
Normal file
14
client/store/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
import uistate from './modules/uistate';
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
const debug = process.env.NODE_ENV !== 'production';
|
||||
|
||||
export default new Vuex.Store({
|
||||
modules: {
|
||||
uistate
|
||||
},
|
||||
strict: debug
|
||||
});
|
||||
25
client/store/modules/uistate.js
Normal file
25
client/store/modules/uistate.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// initial state
|
||||
const state = {
|
||||
asideBarCollapse: false,
|
||||
};
|
||||
|
||||
// getters
|
||||
const getters = {};
|
||||
|
||||
// actions
|
||||
const actions = {};
|
||||
|
||||
// mutations
|
||||
const mutations = {
|
||||
setAsideBarCollapse(state, value) {
|
||||
state.asideBarCollapse = value;
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
getters,
|
||||
actions,
|
||||
mutations
|
||||
};
|
||||
Reference in New Issue
Block a user