mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-20 22:11:01 +08:00
Merge pull request #538 from nagisa77/feature/first_screen
fix: 首屏幕ssr优化
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
/** 切换分类/标签/Tab:useAsyncData 已 watch,这里只需确保 options 加载 **/
|
||||
watch([selectedCategory, selectedTags], () => {
|
||||
loadOptions()
|
||||
|
||||
Reference in New Issue
Block a user