問題:element (el-pagination)刪除最後一頁的全部數據後,currentPage沒更新

處理方法:this

// 刪除需求
        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();
          })
        },
相關文章
相關標籤/搜索