页面栈的问题如何解决?

小程序 文章 2022-01-24 16:40 331 0 全屏看文

AI助手支持GPT4.0

页面栈的问题如何解决?How to solve the problem of page stack?

页面栈的问题如何解决?

我有一个重新拍照的按钮,反复10次后无反应了。看官方是页面栈的问题,该如何解决呢?有大佬知道吗?

使用的是下面这个跳转

wx.navigateTo({

        url: '/pages/printer/copy/head/head',

      })

I have a button to take pictures again. After repeated 10 times, there is no response. See the official page stack problem, how to solve it? Does anyone know? Use the following jump Wx navigateTo({ url: '/pages/printer/copy/head/head', })

回答:

dreamhunter:

没有回退需求直接用wx.redirectTo就行

https://developers.weixin.qq.com/miniprogram/dev/apioute/wx.redirectTo.html

brave:

如果你即将打开的新页面跟当前页面没有交互要求,当前页面无需保留,那就用 wx.redirectTo

Brandon:

wx.navigateTo最多可以跳转10次,建议可以加一个跳转不动了报错用wx.relaunch跳转,如果不能满足我需要反问你一句,点击重新拍照时为啥不用返回上一页,至于状态都可以初始化呀。

-EOF-

AI助手支持GPT4.0