index.js 488 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * APP全局状态管理
  3. *
  4. */
  5. // VUE2的语法格式
  6. // #ifndef VUE3
  7. import Vue from 'vue'
  8. import Vuex from 'vuex'
  9. Vue.use(Vuex)
  10. const store = new Vuex.Store({
  11. // #endif
  12. // VUE3的语法格式
  13. // #ifdef VUE3
  14. import { createStore } from 'vuex'
  15. const store = createStore({
  16. // #endif
  17. //定义应用状态的默认初始值,页面显示所需的数据从该对象中进行读取。
  18. state: {
  19. },
  20. mutations: {
  21. },
  22. getters: {
  23. },
  24. actions: {
  25. }
  26. })
  27. export default store