問題: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