微信小程序連接無法跳轉/ can not navigate to tabBar page錯誤


這里的說的跳轉方式是通過js跳轉如下:

wxml頁面:

<button bindtap="enternews" >進入新聞news頁面</button>

js頁面:

enternews:function(){
wx.navigateTo({
url: '../products/products',//跳轉地址
success: function(res){
console.log(res)// success
},
fail: function() {
console.log('跳轉到news頁面失敗') // fail 
},
complete: function() {
console.log('跳轉到news頁面完成') // complete
}
})
}

  如果在這種情況下無法實現跳轉並出現can not navigate to tabBar page錯誤很有可能是由於在底部tabbar里面定義樂同樣連接地址的bar,如果在底部footer頁面定義了相同地址的bar,則此頁面無法跳轉,

最好是當tabbar定義了相同的跳轉地址在頁面中不要再定義相同的鏈接了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM