后端返回所有的数据前端做分页

this.table = this.tableData.slice((this.currentPage - 1) * this.pagesize , this.currentPage * this.pagesize)
this.total = this.tableData.length;
将后端的接口数据改成如上currentPage 为当前页码,pagesize为展示多少条,tableData为总的数据,不影响分页组件事件和属性使用

你可能感兴趣的:(javascript,javascript,html,html5)