页面使用navigator,点击多次就不能跳转了,只好使用wx.redirectto,但是需返回怎么办
wx.redirectto,但也需要返回键,没有上一页怎么返回呢?
微信小程序中的页面使用wx.redirectto,但也需要返回键,没有上一页怎么返回呢?The page in the WeChat applet uses wx.redirectto, but it also needs a return key. How can I return without the previous page?
微信小程序中的页面使用wx.redirectto,但也需要返回键,没有上一页怎么返回呢?wx.redirectto,但也需要返回键,没有上一页怎么返回呢?
If you use navigator, you can't jump if you click multiple times. You have to use navigator wx.redirectto But what if you need to return wx.redirectto But you also need a return key. How can I return without the previous page?
回答:
redirectto是销毁当前页跳转到新页面。
如果当前页面有上级页面,那么redirectto过去后还是会有返回键的
所以你要判断好是用redirectto还是navigate
还有个方案就是页面都用自定义的导航,自定义导航里自己添加返回键
wx.redirectto销毁上一页面栈。就没有返回键了。navigator可以用防抖处理一下。
规划好页面跳转逻辑