一,引入
<!--分页插件-->
<script type="text/javascript" src="/static/admin/js/jqPaginator.js"></script>
<script type="text/javascript" src="/static/admin/bootstrap/js/jquery-1.10.1.js"></script>
二。
定义一个空的div 让这个div的class pagination
<div class="pagination" id="pagination"></div>
三。js
<script>标签:pagination,num,分页,totalPages,jqPaginator,后台,div,type From: https://www.cnblogs.com/lunar-huazai/p/17204361.html
$('#pagination').jqPaginator({
totalPages: {{.totalPages}},
visiblePages: 5,
currentPage: {{.page}},
onPageChange: function (num,type) {
console.log(num,type)
if (type!='init'){
location.href="/admin/goods?page="+num;
}
}
});
</script>