美文网首页
better-scroll上啦加载

better-scroll上啦加载

作者: 拾钱运 | 来源:发表于2019-05-29 11:50 被阅读0次
 createScroller() {
        this.scroller = new BScroll(this.$refs.scroller, {
          click: true,
          probeType: 3,
          pullUpLoad: {
            threshold: 50
          },
           mouseWheel: {    // pc端同样能滑动
            speed: 20,
            invert: false
        },
        useTransition:false  // 防止iphone微信滑动卡顿
        });
        this.scroller.on('pullingUp',()=>{
            console.log('处理加载更多')
            this.hotpage+=1
            this.hots=true;
            //请求接口
            this.gethotdata().then(
            this.$refs.hotG.lazyload()//图片懒加载
            )
            setTimeout(() => {
            // 事情做完,需要调用此方法告诉 better-scroll 数据已加载,否则上拉事件只会执行一次
                this.scroller.finishPullUp()
                // this.scroller.refresh()
                this.hots=false;
            }, 2000)
        })
      },

相关文章

网友评论

      本文标题:better-scroll上啦加载

      本文链接:https://www.haomeiwen.com/subject/kiietctx.html