<!-- Table表格 -->
<el-table
class="table-form"
:data="tableData.slice((currentPage4-1)*pageSize,currentPage4*pageSize)"
</el-table>
<!-- 分页 -->
<el-pagination
class="paging"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage4"
:page-sizes="[10,20,30,40,50]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="tableData.length"
></el-pagination>
export default {
data() {
const data = [];
return {
//页码
currentPage4: 1,
//分页下默认显示10条每页
pageSize: 10,
};
methods: {
//每页显示的条数
handleSizeChange(val) {
this.pageSize = val;
console.log(`每页 ${val} 条`);
},
//当前页数
handleCurrentChange(val) {
this.currentPage4 = val;
console.log(`当前页: ${val}`);
}
}
};
<style>
.paging {
vertical-align: bottom;
float: right;
}
</style>