【优化】删除 image task 分页,改为 top 前多少数据
This commit is contained in:
parent
dc31aeb24e
commit
63f0a2058d
@ -57,7 +57,8 @@ const getImageList = async () => {
|
|||||||
text: '加载中...'
|
text: '加载中...'
|
||||||
})
|
})
|
||||||
const { list } = await ImageApi.getImageList({pageNo: pageNo.value, pageSize: pageSize.value})
|
const { list } = await ImageApi.getImageList({pageNo: pageNo.value, pageSize: pageSize.value})
|
||||||
imageList.value.push.apply(imageList.value, list)
|
// imageList.value.push.apply(imageList.value, list)
|
||||||
|
imageList.value = list
|
||||||
} finally {
|
} finally {
|
||||||
if (imageTaskLoadingInstance.value) {
|
if (imageTaskLoadingInstance.value) {
|
||||||
imageTaskLoadingInstance.value.close();
|
imageTaskLoadingInstance.value.close();
|
||||||
@ -118,14 +119,15 @@ const downloadImage = async (imageUrl) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleTabsScroll = async () => {
|
const handleTabsScroll = async () => {
|
||||||
if (imageTaskRef.value) {
|
// todo 先不分页,只显示 top 前多少
|
||||||
const { scrollTop, scrollHeight, clientHeight } = imageTaskRef.value;
|
// if (imageTaskRef.value) {
|
||||||
if (scrollTop + clientHeight >= scrollHeight - 20 && !imageTaskLoading.value) {
|
// const { scrollTop, scrollHeight, clientHeight } = imageTaskRef.value;
|
||||||
console.log('分页')
|
// if (scrollTop + clientHeight >= scrollHeight - 20 && !imageTaskLoading.value) {
|
||||||
pageNo.value = pageNo.value + 1
|
// console.log('分页')
|
||||||
await getImageList();
|
// pageNo.value = pageNo.value + 1
|
||||||
}
|
// await getImageList();
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 暴露组件方法 */
|
/** 暴露组件方法 */
|
||||||
|
Loading…
Reference in New Issue
Block a user