微信小程序页面上拉触底,子组件加载更多

微信小程序页面注册中提供了:

onReachBottom()

监听用户上拉触底事件。

同时:
在Component构造器中提供了

selectComponent()

选择器

所以:
在页面中js这样写:

/**
 * 页面上拉触底事件的处理函数
 * #groupTemplate 组件id
 * getTopGroup() 组件methods
 */
onReachBottom: function () {
    this.selectComponent("#groupTemplate").getMoreGroup()
}

需给组件绑定id=‘groupTemplate’

猜你喜欢

转载自blog.csdn.net/weixin_43631810/article/details/84747803
今日推荐