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)