wx.navigateTo:保留当前页,跳转到指定页,非tabBar;使用 wx.navigateBack 可以返回到当前的页面。

wx.redirectTo:关闭当前页,跳转到指定页,非tabBar;将无法回到当前页面。

wx.switchTap:只能用于跳转到tabbar页面,并关闭其他非tabbar页面。

wx.reLaunch:是关闭所有页面,跳转到指定页,非tabBar的页面。

 

有时候跳转还需要携带参数,例如:

wx.navigateTo({
        url: '/pages/item/item?name=' + name,
 })

item页的取值的方式

onLoad: function (options) {
    var that = this;
    that.setData({
      name: options.name,
    })
 }

 

相关文章:

  • 2021-11-24
  • 2021-06-19
  • 1970-01-01
  • 2021-10-15
  • 2021-04-02
  • 2021-06-09
  • 2022-12-23
猜你喜欢
  • 2021-08-17
  • 2021-06-22
  • 2022-12-23
  • 2021-12-03
  • 2022-02-03
  • 2022-12-23
  • 2021-06-02
相关资源
相似解决方案