当前位置:网站首页>Several ways for wechat applet to jump to the page are worth collecting

Several ways for wechat applet to jump to the page are worth collecting

2022-06-25 00:24:00 Mr, Guo

One :js Realization

1、 Keep the current page , Jump to a page in the app

wx.navigateTo({
    
  url: '/pages/wode/wode?param=2323'
})


2.switchTab ( There is no return key , You can only jump to tabBar page , You can't carry parameters )

wx.switchTab({
      
      url: `/pages/wode/wode`,
    })

3、reLaunch ( Jump to any page , No return , Yes home page Button )

    wx.reLaunch({
    
      url: '/pages/wode/wode'
    })

4.redirectTo ( You can only jump tabBar page , No return , But there is a home button )

    wx.redirectTo({
    
       url: `/pages/wode/wode`,
    })

5.navigateBack ( Apply to target page , delta The value is 1 , Jump to the previous page ,2 Indicates skip two levels )

   wx.navigateBack({
    
       delta:1
    })

Two :navigator Component implementation

<navigator url = "/pages/wode/wode"> Jump to a new page </navigator>

<navigator url = "/pages/wode/wode" open-type = "redirect"> Jump to a new page </navigator>

<navigator url = "/pages/wode/wode" open-type = "switchTab"> Jump to a new page </navigator>

原网站

版权声明
本文为[Mr, Guo]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202210548307174.html