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

@@ -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()