diff --git a/src/contentScripts/views/Home/components/Trending.vue b/src/contentScripts/views/Home/components/Trending.vue index 760f8a1c..95a193e6 100644 --- a/src/contentScripts/views/Home/components/Trending.vue +++ b/src/contentScripts/views/Home/components/Trending.vue @@ -24,6 +24,7 @@ const videoList = reactive([]) const isLoading = ref(false) const containerRef = ref() as Ref const pn = ref(1) +const noMoreContent = ref(false) const { handleReachBottom, handlePageRefresh } = useBewlyApp() onMounted(async () => { @@ -36,6 +37,7 @@ onActivated(() => { }) async function initData() { + noMoreContent.value = false videoList.length = 0 pn.value = 1 await getData() @@ -57,6 +59,9 @@ function initPageAction() { } async function getTrendingVideos() { + if (noMoreContent.value) + return + emit('beforeLoading') isLoading.value = true try { @@ -66,7 +71,9 @@ async function getTrendingVideos() { ps: 30, }) - if (response.code === 0 && !response.data.no_more) { + if (response.code === 0) { + noMoreContent.value = response.data.no_more + const resData = [] as VideoItem[] response.data.list.forEach((item: VideoItem) => {