這里的說的跳轉方式是通過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定義了相同的跳轉地址在頁面中不要再定義相同的鏈接了。