通过定时器触发更新 mounted(){// 更新当前页码letpage=Number(localStorage.getItem("saPage"))||1;this.$nextTick(function(){this.change(page);});console.log(this.currentPage2);},// 触发更新change(page){// 模拟数据返回setTimeout(()=>{this.currentPage2=page;// 再次赋值},1000);}<el-pag...
解决el-pagination当前页码bug 点击页码后的当前页是正确的,但获取后端数据后当前页码就变回初始值了,解决方法是在获取数据后再重新赋值。 getData:function(curPage){this.$http('GET',url,function(obj){_this.currentPage=curPage//解决分页控件上当前页码不变的问题...})},...
mounted() { // 更新当前页码 let page = Number(localStorage.getItem("saPage")) || 1; this.$nextTick(function() { this.change(page); }); console.log(this.currentPage2); }, // 触发更新 change(page) { // 模拟数据返回 setTimeout(() => { this.currentPage2 = page; // 再次赋值...