Revert "Reapply "feat: reuse server data on home page""

This reverts commit dbeaefe9ba.
This commit is contained in:
tim
2025-08-11 01:14:51 +08:00
parent 0fdb4c234a
commit ae1a8daa22

View File

@@ -109,7 +109,6 @@
<script>
import { ref, watch } from 'vue'
import { useRoute } from 'vue-router'
import { useState } from '#app'
import { useScrollLoadMore } from '~/utils/loadMore'
import { stripMarkdown } from '~/utils/markdown'
import { API_BASE_URL } from '~/main'
@@ -149,8 +148,8 @@ export default {
.map(v => (isNaN(v) ? v : Number(v)))
}
const tagOptions = useState('index-tagOptions', () => [])
const categoryOptions = useState('index-categoryOptions', () => [])
const tagOptions = ref([])
const categoryOptions = ref([])
const isLoadingPosts = ref(false)
const topics = ref(['最新回复', '最新', '排行榜' /*, '热门', '类别'*/])
const selectedTopic = ref(
@@ -161,12 +160,11 @@ export default {
: '最新回复'
)
const articles = useState('index-articles', () => [])
const page = useState('index-page', () => 0)
const articles = ref([])
const page = ref(0)
const pageSize = 10
const allLoaded = useState('index-allLoaded', () => false)
const initialized = useState('index-initialized', () => false)
const isMobile = useIsMobile()
const allLoaded = ref(false)
const loadOptions = async () => {
if (selectedCategory.value && !isNaN(selectedCategory.value)) {
@@ -379,10 +377,7 @@ export default {
const sanitizeDescription = text => stripMarkdown(text)
if (!initialized.value) {
await Promise.all([loadOptions(), fetchContent()])
initialized.value = true
}
await Promise.all([loadOptions(), fetchContent()])
return {
topics,