直接看代码吧
<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;
}
}