<el-table
:data="list.slice((currentPage-1)*pagesize,currentPage*pagesize)"//限制渲染条数
stripe
style="width: 100%">
</el-table>
<el-pagination
background
:current-page="currentPage"
:page-sizes="[5, 10, 20, 30, 40]"
:page-size="5"
layout="total, sizes, prev, pager, next, jumper"
prev-text="上一页"
next-text="下一页"
:total="list.length"
@size-change="handleSizeChange"
@current-change="currentchange"
style="margin: 100px 600px;">
</el-pagination>
--------------------------------
data() {
return {
list:[],
currentPage:1,
pagesize:10
}
},
methods: {
handleSizeChange: function (size) {
this.pagesize = size;//每页条数
},
currentchange(currentPage){
this.currentPage=currentPage;
console.log(currentPage);//某页
},
}