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.

35 lines
715 B

  1. /** @format */
  2. import { defineStore } from "pinia";
  3. import { ref } from "vue";
  4. // 定义 Store
  5. export const useMarketSituationStore = defineStore(
  6. "marketSituation",
  7. () => {
  8. const cardData = ref([]);
  9. const gloablCardData = ref([]);
  10. const marketDetailCardData = ref([]);
  11. // 记得 return
  12. return {
  13. cardData,
  14. gloablCardData,
  15. marketDetailCardData,
  16. };
  17. },
  18. // TODO: 持久化
  19. {
  20. // 网页端持久化
  21. // persist: true,
  22. // 小程序端持久化
  23. persist: {
  24. storage: {
  25. getItem(key) {
  26. return uni.getStorageSync(key);
  27. },
  28. setItem(key, value) {
  29. uni.setStorageSync(key, value);
  30. },
  31. },
  32. },
  33. }
  34. );