微信小程序中的页面使用wx.redirectto,但也需要返回键,没有上一页怎么返回呢?

小程序 文章 2020-08-05 17:21 1480 0 全屏看文

AI助手支持GPT4.0

微信小程序中的页面使用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,但也需要返回键,没有上一页怎么返回呢?

页面使用navigator,点击多次就不能跳转了,只好使用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?

回答:

微喵网络:

规划好页面跳转逻辑

Admin²⁰²⁰:

redirectto是销毁当前页跳转到新页面。

如果当前页面有上级页面,那么redirectto过去后还是会有返回键的

所以你要判断好是用redirectto还是navigate

还有个方案就是页面都用自定义的导航,自定义导航里自己添加返回键

字如水中:redirectto是返回不了了
?:

wx.redirectto销毁上一页面栈。就没有返回键了。navigator可以用防抖处理一下。

字如水中:你好,请问怎么处理呀
?:如果要返回上一页面 就用navigator,这也是非tabbar页面常用的页面跳转方式。至于你说的点击多次不跳转 是因为嵌套的页面层数有个最大限制,小程序中页面栈最多十层。
字如水中:嗯嗯,使用的是navigator页面链接跳转,需要返回键的,那这个怎么解决呢,,添加事件防止重复点击就可以了吗?
?:是的 防抖 可以去了解一下

-EOF-

AI助手支持GPT4.0