代码如下:
<el-table
:data="tableData.slice((this.currentPage-1)*this.pageSize,this.currentPage*this.pageSize)"
style="width: 100%"
>
<el-table-column prop="date" label="日期"></el-table-column>
<el-table-column prop="name" label="姓名"></el-table-column>
<el-table-column prop="addres" label="地址"></el-table-column>
</el-table>
<el-pagination :current-page.sync="currentPage" :page-size="pageSize"
background layout="prev, pager,next":total="countLen">
</el-pagination>
数据:
currentPage: 1,//当前页
pageSize: 5,//一页显示条数
tableData:[]//数据
computed: {
countLen(){
return this.tableData.length
}
}