步骤:
1.需要引入milo.js
2.手写一个分页的样式
3.分页html代码
4.分页js代码
<script src="//ossweb-img.qq.com/images/js/mobile_bundle/milo.js"></script>
<script>
need("util.ajaxpage", function(jo) {
pageShow = new jo({
oPage: "pageShow",
pageId: "list_page",//对应html结构的分页id
pageNow: curPage,
pageShowNum: 2,
pageTotal: Math.ceil(data["total"] / 4),
style: 3475,
onChange: function(i) {
// console.log(i)
Base.test(i) //点击页码的回调
}
});
});
</script>
//html结构
<div class="page-list" id="list_page"></div>