Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. // 本地分页函数
  2. export function getPaginationData(page: number = 1, pageSize: number = 20, data: any[] = []) {
  3. const offset = (page - 1) * pageSize;
  4. const total = data.length;
  5. return (offset + pageSize >= total) ? data.slice(offset, total) : data.slice(offset, offset + pageSize);
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement