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
35 lines
715 B
/** @format */
|
|
|
|
import { defineStore } from "pinia";
|
|
import { ref } from "vue";
|
|
// 定义 Store
|
|
export const useMarketSituationStore = defineStore(
|
|
"marketSituation",
|
|
() => {
|
|
const cardData = ref([]);
|
|
const gloablCardData = ref([]);
|
|
const marketDetailCardData = ref([]);
|
|
// 记得 return
|
|
return {
|
|
cardData,
|
|
gloablCardData,
|
|
marketDetailCardData,
|
|
};
|
|
},
|
|
// TODO: 持久化
|
|
{
|
|
// 网页端持久化
|
|
// persist: true,
|
|
// 小程序端持久化
|
|
persist: {
|
|
storage: {
|
|
getItem(key) {
|
|
return uni.getStorageSync(key);
|
|
},
|
|
setItem(key, value) {
|
|
uni.setStorageSync(key, value);
|
|
},
|
|
},
|
|
},
|
|
}
|
|
);
|