mirror of
https://gitee.com/bootx/dax-pay-ui.git
synced 2025-09-08 13:18:02 +00:00
fix(mock): fix mock paging tool error
This commit is contained in:
@@ -38,8 +38,10 @@ export function resultError(message = 'Request failed', { code = -1, result = nu
|
||||
}
|
||||
|
||||
export function pagination<T = any>(pageNo: number, pageSize: number, array: T[]): T[] {
|
||||
let offset = (pageNo - 1) * pageSize;
|
||||
return offset + pageSize >= array.length
|
||||
? array.slice(offset, array.length)
|
||||
: array.slice(offset, offset + pageSize);
|
||||
let offset = (pageNo - 1) * Number(pageSize);
|
||||
const ret =
|
||||
offset + Number(pageSize) >= array.length
|
||||
? array.slice(offset, array.length)
|
||||
: array.slice(offset, offset + Number(pageSize));
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user