1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| import Vue from 'vue'
| import Vuex from 'vuex'
| import cloneDeep from 'lodash/cloneDeep'
| import common from './modules/common'
| import user from './modules/user'
| import streetlight from './modules/streetlight'
| import charge from './modules/charge'
| import weather from './modules/weather'
| import led from './modules/led'
| import home from './modules/home'
|
| Vue.use(Vuex)
|
| export default new Vuex.Store({
| modules: {
| common,
| user,
| streetlight,
| charge,
| led,
| weather,
| home
| },
| mutations: {
| // 重置vuex本地储存状态
| resetStore (state) {
| Object.keys(state).forEach((key) => {
| state[key] = cloneDeep(window.SITE_CONFIG['storeState'][key])
| })
| }
| },
| strict: process.env.NODE_ENV !== 'production'
| })
|
|