问题:element (el-pagination)删除最后一页的所有数据后,currentPage没更新


处理方法:

// 删除需求
        delNeed(demand_id){
          API_MyInform.delDemand(demand_id).then(res => {
            this.$layerMessage.success('删除成功!');
            // 更新当前页码
            let totalPage = Math.ceil((this.totalNum - 1)/this.pageSize);
            let currentPage = this.currentPage > totalPage ? totalPage : this.currentPage;
            this.currentPage = this.currentPage < 1 ? 1 : currentPage;
            this.getMyDemandList();
          })
        },

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM