HTML
<el-pagination
@size-change="handlePageSizeClick"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[5, 10, 15]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="totalDataCount">
</el-pagination>
JS
/**
* 分页,当前页码改变第几页
*/
function handleCurrentChange(val) {
this.currentPage = parseInt(val);
// 改变后更新数据表
this.initBeaconsData();
}
/**
* 每页显示多少条
*/
function handlePageSizeClick(val) {
this.pageSize = parseInt(val);
// 改变后更新数据表
this.initBeaconsData();
}
data()
data() {
return {
totalDataCount: 1,
pageSize: 5,
currentPage: 1,
}
}