diff --git a/frontend/components/ArticlesList/Navigation/index.vue b/frontend/components/ArticlesList/Navigation/index.vue index 86f5a3f3..12530769 100644 --- a/frontend/components/ArticlesList/Navigation/index.vue +++ b/frontend/components/ArticlesList/Navigation/index.vue @@ -1,7 +1,7 @@ diff --git a/frontend/components/ArticlesList/index.vue b/frontend/components/ArticlesList/index.vue index 9b989b13..b1d75b43 100644 --- a/frontend/components/ArticlesList/index.vue +++ b/frontend/components/ArticlesList/index.vue @@ -15,7 +15,7 @@ watch(route, async () => { artlist.value = await useFetchPostData(route?.params, route.query?.sort, pagenum = 1) isLoading.value = false }, { deep: true, immediate: true }) -onBeforeMount(() => { +onMounted(() => { (window as any).addEventListener('scroll', addArtListItem) }) onUnmounted(() => { diff --git a/frontend/components/Main/index.vue b/frontend/components/Main/index.vue index 9c1e2004..ec1ae8fa 100644 --- a/frontend/components/Main/index.vue +++ b/frontend/components/Main/index.vue @@ -8,7 +8,7 @@ const route = useRoute()
- +
diff --git a/frontend/composables/Articlelist/useArtlistFn.ts b/frontend/composables/Articlelist/useArtlistFn.ts index d401c04a..f911c3d5 100644 --- a/frontend/composables/Articlelist/useArtlistFn.ts +++ b/frontend/composables/Articlelist/useArtlistFn.ts @@ -4,7 +4,7 @@ export const formatTime = (createdAt: string): string => { const now = new Date() const duration = (now.getTime() - created.getTime()) / 1000 / 60 let ans = '刚刚' - if (duration < 60) // 一小时内 + if (duration > 0 && duration < 60) // 一小时内 ans = `${(duration).toFixed(0)}分钟前` else if (duration < 60 * 24) // 一天内 ans = `${(duration / 60).toFixed(0)}小时前`