uniapp开发小程序中scroll-view无法触发onRea

2021-08-12  本文已影响0人  吴wuwu
<scroll-view :scroll-y="true" style="height: 880rpx;" bindscrolltolower="onReachBottom" lower-threshold="50">
这是内容
<u-loadmore :status="loadStatus" @loadmore="" :load-text="loadText" v-if="CouponGoods.length>=10"></u-loadmore>
</scroll-view>

onReachBottom() {
            if(this.CouponGoods.length>=10&&this.currentList>0) {
                this.current++;
                this.getCouponGoods();
            }
        },

使用bindscrolltolower 绑定请求下一页的方法即可,但是使用scroll-view标签的话,会影响onPageScroll 函数的使用,也就是说我们获取不到页面滚动的高度
lower-threshold number/string 距底部/右边多远时,触发 scrolltolower 事件
bindscrolltolower eventhandle 滚动到底部/右边时触发

上一篇 下一篇

猜你喜欢

热点阅读