From 05b159d5d44bb86e51f85891b7b52034806a8d0a Mon Sep 17 00:00:00 2001 From: Toly Date: Sun, 2 Feb 2025 16:19:31 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20default=20data.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/HomePage.vue | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/views/HomePage.vue b/src/views/HomePage.vue index 67851f1..3a66b7d 100644 --- a/src/views/HomePage.vue +++ b/src/views/HomePage.vue @@ -84,15 +84,44 @@ import Chart from 'chart.js/auto'; import { onMounted, ref } from 'vue'; import { useRouter } from 'vue-router'; -const everyDayWordCount = ref([]); +const everyDayWordCount = ref([ + { + year: '周一', + count: 0, + }, + { + year: '周二', + count: 0, + }, + { + year: '周三', + count: 0, + }, + { + year: '周四', + count: 0, + }, + { + year: '周五', + count: 0, + }, + { + year: '周六', + count: 0, + }, + { + year: '周日', + count: 0, + }, +]); const todayWordCount = ref(0); const router = useRouter(); const defaultGroupID = ref(''); onMounted(async () => { await getGroupList(); + getTodayWordCount(); await getEveryDayWordCount(); - await getTodayWordCount(); createCollectionChart(); });