移动端: //上拉加载
let a = [1,2,3,2,3,4,4,3,3,3,3,3,3,3,2,2,33,34,3,4];
let b = [];
function fn(){
if(a.length>10){
b = b.concat(a.splice(0,10));
}else{
b = b.concat(a);
a = []
}
console.log(b)
}
pc //elementui的分页组件
handleSizeChange(newSize){
this.queryInfo.pagesize = newSize;
this.queryInfo.pagenum = 1;
this.indexResultTable = this.tableData.slice(0,this.queryInfo.pagesize);
}
handleCurrentChange(newPage){
this.queryinfo.pagenum =newPage;
if(newPage === 1){
this.indexResultTable = this.tableData.slice(0,this.queryInfo.pagesize);
return;
}
newPage = (newPage - 1)*this.queryInfo.pagesize;
this.indexResultTable = this.tableData.slice(newPage,newPage+this.queryInfo.pagesize)
}
|