after the table is paged, click on the preview of a row after turning to the second page, and you will get the data of the corresponding row of one page, but the data list of the paged page is correct
. pagination on the table
: data= "testpage.slice ((currentPage-1) pagesize,currentPage pagesize)"
< el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[5,10,15]"
:page-size="pagesize"
layout="total,jumper,prev, pager, next,sizes"
:total="testpage.length" >
< / el-pagination >
Preview button
< el-button @ click= "yulan (scope.$index,scope.row)" > Preview < / el-button >
/ / Preview
yulan (index,row) {
let self=this;
/ / this.$message ("Preview" + (index+1) + "Line")
let iData = this.testpage[index]; //
console.log(iData.peo)
console.log(iData)
},
/ / pagination
/ initial page currentPage, initial number of data per page pagesize and data testpage
handleSizeChange:function (size) {
this.pagesize=size;
},
handleCurrentChange:function (currentPage) {
this.currentPage=currentPage;
}