Skip to content

Commit

Permalink
Merge pull request #296 from MarleneJiang/issue-295-文章列表没有数据时不触底更新
Browse files Browse the repository at this point in the history
Issue 295 文章列表没有数据时不触底更新
  • Loading branch information
MarleneJiang authored Feb 20, 2023
2 parents 48807a0 + 6f9e129 commit cb92950
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/components/ArticlesList/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ const isLoading = useState('isLoading', () => false)
const route = useRoute()
let pagenum = 1
const addArtListItem = useThrottle(async () => {
useScrollBottom() && artlist.value.push(...(await useFetchPostData(route?.params, route.query?.sort, ++pagenum)))
useScrollBottom() && artlist.value?.length && artlist.value.push(...(await useFetchPostData(route?.params, route.query?.sort, ++pagenum)))
})
provide('artlist', artlist)
provide('ads', articleAds)
watch(route, async () => {
watch([() => route.query, () => route.params], async () => {
isLoading.value = true
artlist.value = await useFetchPostData(route?.params, route.query?.sort, pagenum = 1)
isLoading.value = false
Expand Down

1 comment on commit cb92950

@vercel
Copy link

@vercel vercel bot commented on cb92950 Feb 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.