uni-events-helper-wx
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
543 B

3 years ago
3 years ago
3 years ago
  1. import Vue from "vue";
  2. import Vuex from "vuex";
  3. Vue.use(Vuex);
  4. const files = require.context("./modules", false, /\.js$/);
  5. let modules = {
  6. state: {},
  7. mutations: {},
  8. actions: {},
  9. getters:{}
  10. };
  11. files.keys().forEach((key) => {
  12. Object.assign(modules.state, files(key)["state"]);
  13. Object.assign(modules.mutations, files(key)["mutations"]);
  14. Object.assign(modules.actions, files(key)["actions"]);
  15. Object.assign(modules.getters, files(key)["getters"]);
  16. });
  17. const store = new Vuex.Store(modules);
  18. export default store;