阅读:2517回复:0
element中使用前端分页前端分页 当后端没有分页的时候 用element中的组件分页并不能对数据进行切割 需要请求回数据后自己来做切割 <el-table :data="tableData.slice((queryParams.currentPage-1)*queryParams.pageSize,queryParams.currentPage*queryParams.pageSize)" :height="$TABLE_HEIGHT-55" style="width: 100%">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="queryParams.currentPage" :page-size="queryParams.pagesize" layout="total, sizes, prev, pager, next" :total=total> </el-pagination> data:{ queryParams{ currentPage:1, pagesize:10, } } mathods:
this.pageSize = val; }, handleCurrentChange(val) { this.currentPage = val; } https://blog.csdn.net/my466879168/article/details/104728538 |
|