fix
This commit is contained in:
@@ -86,8 +86,7 @@ export function usePagination(
|
||||
const res = await requestFn(params)
|
||||
|
||||
const rawData = res[dataKey]
|
||||
const total = res[totalKey] || 99999999
|
||||
console.log(total, rawData)
|
||||
|
||||
const data = typeof transformFn === 'function' ? transformFn(rawData) : rawData
|
||||
|
||||
if (type === 'refresh') {
|
||||
@@ -96,9 +95,9 @@ export function usePagination(
|
||||
list.value.push(...data)
|
||||
}
|
||||
|
||||
const total = res[totalKey] || list.value?.length
|
||||
pageState.total = total
|
||||
pageState.maxPage = Math.ceil(total / pageState.pageSize)
|
||||
|
||||
finished.value = list.value.length >= total
|
||||
empty.value = list.value.length === 0
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user