首先引入分页插件maven依赖
注意–使用mybatis-plus时,该插件失效,使用mybatis才可正常使用
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.10</version>
</dependency>
前端页面书写
layui.use('table', function(){
var table = layui.table;
table.render({
elem: '#dates'
,url:'/admin/selectusertable'
,totalRow: true //开启合计行
,limit:5 //默认为10
,limits:[5,10