在mpvue中,onPullDownRefresh直接能用
1、首先要保证配置
{
path: 'pages/user',
config: {
navigationBarTitleText: '个人中心',
navigationBarBackgroundColor: theme['@primary-color'],
enablePullDownRefresh: true
}
}
2、和methods同层级写
onPullDownRefresh() {
wx.showNavigationBarLoading()
console.log('pull')
wx.stopPullDownRefresh()
}
本文详细介绍在MPVue中实现下拉刷新功能的具体步骤。首先,确保页面配置中enablePullDownRefresh属性设置为true,然后在页面方法中定义onPullDownRefresh函数,使用wx.showNavigationBarLoading()显示加载提示,调用wx.stopPullDownRefresh()结束刷新。
2501

被折叠的 条评论
为什么被折叠?



