如何将element-ui中的表格和分页器连接起来

直接看代码吧

<el-table :data="tableData.slice((currentPage-1)*pagesize,currentPage*pagesize)" 
border
style="width:100%" >
......
</el-table>
<el-pagination small 
layout="total,prev,pager,next,jumper" 
:total="tableData.length"
:page-size="pagesize"
pager-count="5"
:current-page="currentPage"
@current-change="handleCurrentChange"
></el-pagination>
data(){
    return{
        pagesize:5,
	currentPage:1
    }
},
methods: {
	handleCurrentChange(val){
		this.currentPage = val;
				
	}
}

 

    原文作者:仗剑东游的猫
    原文地址: https://blog.csdn.net/miao_yf/article/details/93619060
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞