html 代码
<div class="pagination">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10]"
:page-size="pageSize"
layout="total,sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
分页动作
tableListLoadData(){
this.loading = true;
this.$axios.post('/pm' + '/test/list', this.$qs.stringify(this.tableList.queryParams, {
}))
.then(res => {
const data = res.data.resultData ;
this.postList = data.list
this.total = Number(data.totalCount);
this.loading = false;
}).catch(error => {
console.log(error);
this.msgError("请求失败");
})
},
handleSizeChange(val) {
thispageSize=val;
this.tableListLoadData();
},
handleCurrentChange(val) {
thiscurrentPage = val;
this.tableListLoadData();
},
|