uni.navigateTo(
{
url:'../news/index',
success:()=> {
console.log(1);
},
fail: (res) => {
console.log('navigate failed',res);
}
}

报错:

navigateTo:fail can not navigateTo a tabbar page

navigateTo不能跳转至具有tabbar的页面

解决方法

利用switchtab替换navigateTo

uni.switchTab(
{
url:'../news/index',
success:()=> {
console.log(1);
},
fail: (res) => {
console.log('navigate failed',res);
}
}
)