小程序实现点击事件更新数据返回上一页更新数据
//点击成功更新数据
if (getCurrentPages().length != 0) {
//刷新当前页面的数据
getCurrentPages()[getCurrentPages().length - 1].onLoad()
}
onShow() { //返回显示页面状态函数
if (getCurrentPages().length != 0) {
//刷新当前页面的数据
getCurrentPages()[getCurrentPages().length - 1].onLoad()
}
},
在你点击事件里调用成功时候把上面代码放进去,意思就是帮你重新调用onLoad()这个方法
有什么问题欢迎评论留言,我会及时回复你的。