Guest User

Untitled

a guest
Aug 20th, 2019
59
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data