Skip to content

xiekun1992/pagination

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

pagination

一个分页插件

options:

  • container: 分页插件的父级元素
  • pageSize: 每页展示的数据条数
  • pageTotal: 共有多少条数据
  • btnNum: 分页按钮数量,不包括上下翻页按钮

events:

  • pagination.init: 分页插件初始化之后触发
  • pagination.select: 点击分页按钮之后触发
  • pagination.destroy: 分页插件被销毁之后触发

API:

  • init(): 初始化分页插件
  • select(page): 跳转到特定页码
  • destroy(): 销毁分页插件,然后将分页插件的引用置为null即可释放内存
var pagination = document.querySelector("#pagination");
var p = new _x.Pagination({
    container: pagination,
    pageSize: 1,
    pageTotal: 10,
    btnNum: 5
});
p.on('pagination.init', function(){
    console.log('init');
});
p.on('pagination.select', function(page){
    console.log(page);
});
p.on('pagination.destroy', function(){
    console.log('destroyed');
});
p.init();

About

一个分页插件

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published