From fd44bfd380dde7cad06e2e813003461f601af926 Mon Sep 17 00:00:00 2001 From: raoyongjun <785755591@qq.com> Date: Sat, 27 Apr 2024 11:32:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=AC=A1=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/content/Content.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/views/home/content/Content.vue b/src/views/home/content/Content.vue index 4ff7e28..9861822 100644 --- a/src/views/home/content/Content.vue +++ b/src/views/home/content/Content.vue @@ -6,7 +6,7 @@ import { useInfiniteScroll } from '@vueuse/core' import dayjs from 'dayjs' // import imagesloaded from 'imagesloaded' -import { cloneDeep, debounce } from 'lodash-es' +import { cloneDeep, debounce, isEqual } from 'lodash-es' // import Masonry from 'masonry-layout' import { NIcon, useMessage } from 'naive-ui' @@ -140,6 +140,7 @@ const listStyle = computed(() => { useInfiniteScroll( el as any, () => { + console.log('初始化加载了') loadMore() }, { distance: 10, canLoadMore: () => canloadMore }, @@ -201,6 +202,7 @@ configStore.$subscribe(() => { watch( () => searchValue.value, async (newVal, oldVal) => { + console.log('搜索框的值', newVal, oldVal) if (newVal) { isInitSeaerch.value = true pagination.pageNo = 0 @@ -222,7 +224,8 @@ watch( watch( () => configStore.getAsideValue, async (newVal, oldVal) => { - if (newVal) { + console.log('getAsideValue变化了', newVal, oldVal, isEqual(newVal, oldVal)) + if (pagination.pageNo > 1 && newVal && !(Object.entries(newVal).toString() === Object.entries(oldVal).toString())) { reset() loadMore() } @@ -542,6 +545,7 @@ async function refreshHandler(filtersearchId?: any) { if (filtersearchId) filterId = filtersearchId + console.log('refreshHandler执行了') loadMore(true) // nextTick(() => { // setTimeout(() => { @@ -643,7 +647,7 @@ function refresh(val?: any) { if (timer.value) clearInterval(timer.value) - + console.log('refresh刷新了') reset() loadMore() configStore.setTimeNum(0)