- Element-UI提供了分页器的两个方法,handleSizeChange和handleCurrentChange,然而在实际使用中,却发现再切换页面展示数量的时候,会出现一些BUG, 页面刷新了,高亮页码却还是上次选择的页面。可以用以下方法解决;
data(){
return:{
yema1:{
currentPage1:1;
pageSize1:10;
}
}
}
methods:{
handleSizeChange1(val) {
this.yema1.currentPage1 = 1;
this.yema1.pageSize1 = val;
//获取页面方法
this.getlist(this.yema1.currentPage1, val)
},
handleCurrentChange1(val) {
this.yema1.currentPage1 = val;
this.getlist(val, this.yema1.pageSize1)
},
}
欢迎大家入QQ群进行技术交流