小程序子组件触底向上滑动加载新数据简单示例

微信   2025-02-04 20:38   80   0  

index.wxml

<scroll-view
    class='pages-container'
    scroll-y="true"
 
    // 设置 触摸底部控件
    bindscrolltolower="bottomRefresh"
    lower-threshold='100'
 
    // 务必要设置的高度
    style='height:100%;'
>
  <!-- other code ... -->
</scroll-view>


index.js

// 手指滑动到底部后触发 '触底刷新加载更多操作'
  bottomRefresh() {
    console.log('到达底部了,加载更多电影文件内容')
  },


index.wxss

page{
    width:100%;
    height:100%;
}
 
scroll-view {
    height:100%;
    /* other the code.. */
}


博客评论
还没有人评论,赶紧抢个沙发~
发表评论
说明:请文明发言,共建和谐网络,您的个人信息不会被公开显示。