From 0ef2840f008993f0cca3fa23faba7c6de31161a2 Mon Sep 17 00:00:00 2001 From: zheng020 Date: Thu, 14 May 2026 11:29:51 +0800 Subject: [PATCH] fix: use reactive array instead of Set for newRecordIds --- .../support-activity/components/ContributionList.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/pages/support-activity/components/ContributionList.vue b/frontend/pages/support-activity/components/ContributionList.vue index 0a55090..6151923 100644 --- a/frontend/pages/support-activity/components/ContributionList.vue +++ b/frontend/pages/support-activity/components/ContributionList.vue @@ -34,7 +34,7 @@ const props = defineProps({ const visible = ref(true) const isPageActive = ref(true) -const newRecordIds = ref(new Set()) +const newRecordIds = ref([]) // 使用轮询 composable const { records, loading, error, start, stop, refresh } = useContributionPolling( @@ -44,7 +44,7 @@ const { records, loading, error, start, stop, refresh } = useContributionPolling // 判断记录是否为新记录(刚加入的) function isNewRecord(id) { - return newRecordIds.value.has(id) + return newRecordIds.value.includes(id) } // 监听 records 变化,标记新记录 @@ -56,10 +56,10 @@ watch(records, (newRecords, oldRecords) => { // 找出新增的记录ID for (const id of newIds) { if (!oldIds.includes(id)) { - newRecordIds.value.add(id) + newRecordIds.value.push(id) // 2秒后移除新记录标记 setTimeout(() => { - newRecordIds.value.delete(id) + newRecordIds.value = newRecordIds.value.filter(i => i !== id) }, 2000) } }