fix: 首屏幕ssr优化

This commit is contained in:
Tim
2025-08-14 12:29:08 +08:00
parent cdea1ab911
commit d2b68119bd
2 changed files with 4 additions and 15 deletions

View File

@@ -8,7 +8,7 @@
</button>
<span v-if="isMobile && unreadCount > 0" class="menu-unread-dot"></span>
</div>
<div class="logo-container" @click="goToHome">
<NuxtLink class="logo-container" to="/">
<img
alt="OpenIsle"
src="https://openisle-1307107697.cos.ap-guangzhou.myqcloud.com/assert/image.png"
@@ -16,7 +16,7 @@
height="60"
/>
<div class="logo-text">OpenIsle</div>
</div>
</NuxtLink>
</div>
<ClientOnly>
@@ -184,6 +184,8 @@ onMounted(async () => {
font-size: 20px;
font-weight: bold;
cursor: pointer;
text-decoration: none;
color: inherit;
}
.header-content {

View File

@@ -339,19 +339,6 @@ watch(
{ immediate: true },
)
/** 外部刷新事件(发帖后刷新首屏) **/
const refreshHome = async () => {
selectedCategory.value = ''
selectedTags.value = []
await refreshFirst()
}
onMounted(() => {
window.addEventListener('refresh-home', refreshHome)
})
onBeforeUnmount(() => {
window.removeEventListener('refresh-home', refreshHome)
})
/** 切换分类/标签/TabuseAsyncData 已 watch这里只需确保 options 加载 **/
watch([selectedCategory, selectedTags], () => {
loadOptions()