feat: add refresh home

This commit is contained in:
tim
2025-08-15 13:24:00 +08:00
parent f025e82e7c
commit 84ca6fd28c
2 changed files with 3 additions and 1 deletions

View File

@@ -127,6 +127,7 @@ const goToNewPost = () => {
const refrechData = async () => {
await fetchUnreadCount()
window.dispatchEvent(new Event('refresh-home'))
}
const headerMenuItems = computed(() => [

View File

@@ -351,6 +351,8 @@ if (import.meta.server) {
}
onMounted(() => {
if (categoryOptions.value.length === 0 && tagOptions.value.length === 0) loadOptions()
window.addEventListener('refresh-home', refreshFirst)
})
/** 其他工具函数 **/
@@ -381,7 +383,6 @@ const sanitizeDescription = (text) => stripMarkdown(text)
font-weight: bold;
}
.loading-container {
display: flex;
justify-content: center;