先看效果图
1.在data中定义分页属性
2.在el-table中给表格绑定的数据进行分页处理
:data="tableData.slice((queryparam.pageNo - 1) * queryparam.pageSize, queryparam.pageNo * queryparam.pageSize)"
3.分页组件事件方法的处理
3.1通过当前页改变事件来进行切换数据
//分页--当前页change事件
handleCurrentChange(val) {
const page = this;
this.queryparam.pageNo = val;
}
4.记得要把请求到的表格数据长度赋值给分页的total
this.queryparam.total=this.tableData.length;
-------------完成