<el-pagination
style="margin-top: 30px"
background
layout="sizes,prev, pager, next"
:total="countLine"
@current-change="onCurrentChange"
:page-size="pageSize"
:page-sizes="[5, 10, 15, 20]"
@size-change="handleSizeChange"
>
</el-pagination>
layout="sizes,prev, pager, next"这个就是布局👇
sizes就是左边这个可选页数
点击每个页码后更新查询:
onCurrentChange(page){//分页
console.log("当前页码",page)//拿到当前页码
this.page=page
this.search()
},
点击选择每页几条后,再次查询:
handleSizeChange(val) {
/*console.log(`每页 ${val} 条`);*/
this.pageSize=val
this.search()
},
}