js layui 分页脚本

//分页
layui.use(['laypage'], function(){
    var laypage = layui.laypage;
    laypage.render({
      elem: 'page'
      ,count:<?=$page_count?>
      ,curr:<?=$page?>
      ,limit:20
      ,jump: function(obj,first){
        //首次不执行
        if(!first){
            var o = GetRequest();
                o.page = obj.curr;
                o.url  = '/goods/lists';
            window.location.href = createUrl(o);
        }
      }
    });
});
posted @ 2018-03-09 15:42  geek程序员  阅读(452)  评论(0编辑  收藏  举报