Page assignment is 2 but page highlight is "1",
when the paging is 2, click the edit button that shows the list information, and then click the back button to return to the sessionStorage or take the last page number, but after the return, it is found that the queried data is correct
.<el-pagination background v-if="pageDiv"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
layout=" prev, pager, next,sizes, jumper"
:total="total">
</el-pagination>
<-- js-->
data(){
return{
currentPage:1
}
},
methods:{
//
handleSizeChange(val) {
this.pageSize=val;
this.queryTable(this.pageSize,this.currentPage);
},
//
handleCurrentChange(val) {
this.currentPage=val;
this.queryTable(this.pageSize,this.currentPage);
},
//
queryTable(pageSize,currentPage){}
}
mounted(){
this.currentPage = Number(sessionStorage.pageIndex);
this.queryTable(pageSize,currentPage);
}
want to return from the editing page, the page number displayed is the page number displayed when the last click; for example, select a piece of data from page 2 to edit, jump to the edit page, and store the page number to sessionStorage at the same time, when the editor returns, you want to return to page 2, however, the query data is the second page data, but the paging highlight is the first page.
ask all the great gods for advice! Thank you