Merge pull request 'feat: 修改加载次数问题' (#271) from fix/updatesyspic into test

Reviewed-on: #271
pull/272/head
yaoshuli 1 year ago
commit 75eb7275ef

@ -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)

Loading…
Cancel
Save