码迷,mamicode.com
首页 > 其他好文 > 详细

element中分页(Pagination)组件的点前进键会跳两页的原因

时间:2020-11-01 10:04:50      阅读:13      评论:0      收藏:0      [点我收藏+]

标签:enum   tcl   OLE   log   news   current   extc   ons   ntc   

element中分页(Pagination)组件点前进键有时会跳两页

原因是

 currentchange(current){
        // this.$emit(‘show‘,{page:current,size:this.pageination.pageSize});
        console.log("currentchange");
        this.setPagenum(current);
        this.show();
      },
        sizechange(newsize){
          console.log("sizechange");
          // this.$emit(‘show‘,{page:this.pageination.pageNum,size:newsize});
          this.setPagesize(newsize);
          this.show();
        },
      prevclick(current){
        //  this.$emit(‘show‘,{page:current-1,size:this.pageination.pageSize}) 
        console.log("prevclick");
        this.setPagenum(current);
        this.show();
      },
      nextclick(current){
        console.log("nextclick");
          // this.$emit(‘show‘,{page:current+1,size:this.pageination.pageSize}) 
        this.setPagenum(current+1);
        this.show();
      },
 
我定义了 prevclick   nextclick currentchange三个方法
但是点击前进键会调用nextclick currentchange两个方法,
后退键同理, 所以只需要吧这两个 prevclick   nextclick删除就好了
 currentchange(current){
        // this.$emit(‘show‘,{page:current,size:this.pageination.pageSize});
        console.log("currentchange");
        this.setPagenum(current);
        this.show();
      },
        sizechange(newsize){
          console.log("sizechange");
          // this.$emit(‘show‘,{page:this.pageination.pageNum,size:newsize});
          this.setPagesize(newsize);
          this.show();
        },

element中分页(Pagination)组件的点前进键会跳两页的原因

标签:enum   tcl   OLE   log   news   current   extc   ons   ntc   

原文地址:https://www.cnblogs.com/bdlz201002/p/13906365.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!