【小程序】小程序switchTab切换tabbar

文档中说 wx.switchTab跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面。我现在有两个tabbar页面(home,center)。我在center的onShow中打印console.log(getCurrentPages())。当我从home点击跳到center的时候打印出来的页面栈只有center,没有home,这是为何?

回答

参考这篇文章
https://segmentfault.com/a/11...

wx.switchTab页面栈估计和wx.redirectTo运行差不多

【小程序】小程序switchTab切换tabbar

wx.reLaunch(OBJECT)

关闭所有页面,打开到应用内的某个页面。

https://developers.weixin.qq.com/miniprogram/dev/api/ui-navigate.html#wxredirecttoobject

以上是 【小程序】小程序switchTab切换tabbar 的全部内容, 来源链接: utcz.com/a/82673.html

回到顶部