Blame view

src/store/index.js 503 Bytes
843fce64e   wulunyi   feat(master): 加入 ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  import Vue from 'vue'
  import Vuex from 'vuex'
  
  Vue.use(Vuex)
  
  const modulesFiles = require.context('./modules', true, /\.js$/)
  
  const modules = modulesFiles.keys().reduce((modules, modulePath) => {
    const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
    const value = modulesFiles(modulePath)
  
    modules[moduleName] = value.default
  
    return modules
  }, {})
  
  const store = new Vuex.Store({
      modules,
      getters: {
7a2dda446   BigBoss   首页逻辑修改
20
          // list: state => state.test.list
843fce64e   wulunyi   feat(master): 加入 ...
21
22
23
24
      }
  })
    
  export default store;