Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 本地分页函数
- export function getPaginationData(page: number = 1, pageSize: number = 20, data: any[] = []) {
- const offset = (page - 1) * pageSize;
- const total = data.length;
- return (offset + pageSize >= total) ? data.slice(offset, total) : data.slice(offset, offset + pageSize);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement