vue页面
<button @click=“prevPage()”> 上一页
第{{currentPage}}页/共{{totalPage}}页
<button @click=“nextPage()”>下一页
js页面
//前端纯分页操作
setCurrentPageData() {
let begin = (this.currentPage - 1) * this.pageSizeTrackNumber;
let end = this.currentPage * this.pageSizeTrackNumber;
this.dataShow = this.projectStageInfoListOne.slice(
begin, end
);
console.log(“页码问题”, begin, end, this.projectStageInfoListOne, this.dataShow, this.currentPage)
},
prevPage() {
console.log(“检验页码99999”, this.currentPage)
if (this.currentPage == 1) return
this.currentPage–;
this.setCurrentPageData()
},
nextPage() {
console.log(“检验页码-next”, this.currentPage)
if (this.currentPage == this.totalPage) return
this.currentPage++;
this.setCurrentPageData()
},