当后端没有分页的时候 用element中的组件分页并不能对数据进行切割 需要请求回数据后自己来做切割
<el-table :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)" :height="$TABLE_HEIGHT-55" style="width: 100%">
<!--分页组件-->
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-size="pagesize"
layout="total, sizes, prev, pager, next"
:total=total>
</el-pagination>
handleSizeChange(val) {
this.pagesize = val;
},
handleCurrentChange(val) {
this.currentPage = val;
}原文:https://www.cnblogs.com/my466879168/p/12441189.html