微信小程序 页面刷新

这里只写了我用到的方法

1. 当前页面刷新

//获取页码数进行刷新
    const pages = getCurrentPages()
                    const perpage = pages[pages.length - 1]
                    perpage.onLoad()

2. 返回上一页刷新

//获取页码数进行刷新,跟当前页面的刷新的方式是一样的

var pages = getCurrentPages()
 //对上一页进行刷新
 pages[pages.length -2 ].onload() 
发布了45 篇原创文章 · 获赞 6 · 访问量 1180

猜你喜欢

转载自blog.csdn.net/qq_41219586/article/details/103528970