feat: 主页缓存

This commit is contained in:
tim
2025-08-05 01:04:01 +08:00
parent 42c3ef3377
commit 730d5b1d10
2 changed files with 34 additions and 7 deletions

View File

@@ -107,7 +107,7 @@
</template>
<script>
import { ref, onMounted, watch, onActivated, onDeactivated, nextTick } from 'vue'
import { ref, onMounted, watch, onActivated, nextTick } from 'vue'
import { useRoute } from 'vue-router'
import { stripMarkdown } from '../utils/markdown'
import { API_BASE_URL } from '../main'
@@ -175,12 +175,6 @@ export default {
})
})
onDeactivated(() => {
if (homePage.value) {
savedScrollTop.value = homePage.value.scrollTop
}
})
const countComments = (list) =>
list.reduce((sum, c) => sum + 1 + countComments(c.replies || []), 0)