diff --git a/src/pages/index/components/calendar.vue b/src/pages/index/components/calendar.vue index 5bbe4fc1..5045575d 100644 --- a/src/pages/index/components/calendar.vue +++ b/src/pages/index/components/calendar.vue @@ -106,11 +106,13 @@ } return _arr }) - onMounted(() => { + const initDate = () => { nowDate.value = new Date() activeDate.value = formatDate(nowDate.value, 'yyyy-MM-dd') todayWeek.value = nowDate.value.getDay() - }) + } + defineExpose({ initDate }) + onMounted(() => {}) + \ No newline at end of file diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 5b6948c8..ddf75a85 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -143,7 +143,7 @@ - + @@ -180,6 +180,7 @@ const no_read_message_num = ref(0); const classScrollRef = ref([]); + const toduRef = ref(null) // 处理显示的消息数量文本 const messageDisplayText = computed(() => { return no_read_message_num.value > 99 ? '99+' : no_read_message_num.value; @@ -333,6 +334,7 @@ statistics_data['get_statistics_data'](); // 获取统计数据 nextTick(() => { classScrollRef.value.forEach((item) => item?.get_data()); + toduRef.value.initCalendar() }); noticeMessageCount().then((res) => { no_read_message_num.value = res.body;