element-ui在使用el-dialog弹出一个有页码的页面时,页码出现的问题

有两页。我点击查看第二页的话下次再打开同一个弹窗,它显示的还是第二页的内容。并且我打开其他的弹窗他给后台的页面竟然也是2.。。导致数据出错。

所以在点击页面切换内容的时候我们就需要处理一下,并且点击弹窗的时候也要把页面从新变成1.下面标红的就是我加上的。

close(){
                this.itemPage=1;
            },

getDicItemLists(type=0){//获取条目内容
                if(type==0){this.itemPage=1;}//打开的时候都是1,只要点击某一页才传页码
                let para = {
                    diccode:this.diccode,
                    page:this.itemPage,
                    filters:this.filtersDic,
              }
                this.listLoading1 = true;
                getSchoolDicItemList(para).then((res) => {
                    this.totalItem = res.total;
                    this.dicitems = res.data;
                    this.listLoading1 = false;
                });
                
            },

handleCurrentChangeItem(val){//字典条目切换页码
                this.itemPage=val;
                this.getDicItemLists(1);
            },

猜你喜欢

转载自blog.csdn.net/qq_33769914/article/details/81948553
今日推荐