使用wx.redirectTo进行跳转时,默认是带有返回首页按钮的。

解决方案:
在onShow里执行wx.hideHomeButton(),就可以隐藏返回首页按钮。
onShow() {
if (wx.canIUse('hideHomeButton')) {
wx.hideHomeButton()
}
},
当使用wx.redirectTo进行页面跳转时,默认会显示返回首页的按钮。可以通过在页面的onShow生命周期方法中检测wx.canIUse(hideHomeButton),如果支持则调用wx.hideHomeButton()来隐藏这个按钮,从而定制用户体验。
使用wx.redirectTo进行跳转时,默认是带有返回首页按钮的。

在onShow里执行wx.hideHomeButton(),就可以隐藏返回首页按钮。
onShow() {
if (wx.canIUse('hideHomeButton')) {
wx.hideHomeButton()
}
},

被折叠的 条评论
为什么被折叠?