fix: bug
This commit is contained in:
@@ -50,7 +50,6 @@ function useListPageRequest(
|
||||
...getPagingParams.value,
|
||||
...customParams,
|
||||
})
|
||||
console.log(data)
|
||||
data.forEach((item: any) => {
|
||||
if (String(item.createtime).length < 11) {
|
||||
item.createtime = item.createtime * 1000
|
||||
@@ -59,17 +58,24 @@ function useListPageRequest(
|
||||
item.image = getImageUrl(item.image)
|
||||
})
|
||||
// totalPage.value = data.count ? Math.ceil(data.count / pagingParams.value.limit!) : 0
|
||||
// 如果当前是第一页,则清空列表,否则追加数据
|
||||
if (getPagingParams.value.page === 1) {
|
||||
list.value = []
|
||||
}
|
||||
list.value.push(...data)
|
||||
}
|
||||
|
||||
const onReload = async (params?: AnyObject) => {
|
||||
// 如果当前是第一页,则清空列表
|
||||
if (getPagingParams.value.page === 1) {
|
||||
list.value = []
|
||||
}
|
||||
loading.value = true
|
||||
pagingParams.value.page = 1
|
||||
if (params) {
|
||||
customParams = params
|
||||
}
|
||||
try {
|
||||
list.value = []
|
||||
await loadData()
|
||||
} finally {
|
||||
loading.value = false
|
||||
|
||||
Reference in New Issue
Block a user