问题: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();
          })
        },

 

posted @ 2020-03-25 14:04  小白&小菜  阅读(1697)  评论(0编辑  收藏  举报
我是一个小菜鸟,飞呀飞呀,快飞高