interface Store {
selLeaderBoardItemKey: 'tradeStatisticsRef'; // 统计排行榜选中的key
period: string; // 日期具体值
periodType: PeriodType; // 日期类型
}
export const store: Store = reactive({
selLeaderBoardItemKey: 'tradeStatisticsRef',
period: '',
periodType: 3
});
export const statisticsType = computed(() => {
const statisticsTypeMap = {
tradeStatisticsRef: 1
};
console.log('store.selLeaderBoardItemKey', store.selLeaderBoardItemKey);
return statisticsTypeMap[store.selLeaderBoardItemKey] as StatisticsType;
});
上面这样写不行, 放在store里面也不行