main.js 322 B

12345678910111213141516
  1. // #ifdef VUE2
  2. import Vue from 'vue';
  3. import Vuex from 'vuex';
  4. if (uni.store == undefined) {
  5. Vue.use(Vuex);
  6. const store = new Vuex.Store({state: {}});
  7. uni.store = store;
  8. };
  9. // #endif
  10. // #ifdef VUE3
  11. import {reactive} from "vue";
  12. if (uni.store == undefined) {
  13. const store = reactive({});
  14. uni.store = store;
  15. };
  16. // #endif