微信小程序,实现页面跳转功能,有那些函数可用?
发布于 作者:苏南大叔 来源:程序如此灵动~

微信小程序的页面跳转函数,也不断刷新大伙的认识。不是一个a标签就能解决的问题,当然也不是一个window.location.href能解决的问题。苏南大叔今天给大家带来的就是相关函数的功能对比。
目前来说,一共有3个js函数是用来微信小程序的页面跳转的。
wx.redirectTo
wx.navigateTo
wx.switchTab
对比说明
redirectTo,页面跳转完之后,顶部没有返回按钮。
navigateTo,页面跳转完毕后,顶部有返回按钮。
redirectTo和navigateTo都不能跳转到tabbar相关页面上。(这个设定太变态了)。
想跳转到tabbar相关的页面上的话,就必须使用switchTab。tab切换的时候,顶部没有返回按钮。
总结
更多微信小程序的相关文章,请点击苏南大叔的文章:


