2.0.1 • Published 3 years ago

paging-computed v2.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

Intro

前端分頁計算的小工具,主要是為了要解決當使用者訪問列表,如何顯示分頁的 ICON,哪一些顯示哪一些不顯示

Install

npm i paging-computed

Example

var PageHelper = require("paging-computed")
/** 顯示多少個頁碼 */
let range = 10
/** 當前頁碼 */
let nowPage = 1
/** 總共多少頁 */
let maxPage = 30

let {prev, multiPagePrev, pages, multiPageNext, next} = new PageHelper(range).GetResult(nowPage, maxPage)
/**
 * Result Should Be:
 * {
 *      prev: false, 
 *      multiPagePrev: false, 
 *      pages: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 
 *      multiPageNext: true, 
 *      next: true
 * }
 */
2.0.1

3 years ago

2.0.0

3 years ago

1.1.0

3 years ago

1.0.6

4 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago