绑定了一个点击事件
跳转
下面是事件的内容
tiao:function(e){
wx.navigateTo({
url: '../index/index',//页面跳转相对路径要写清楚且准确
success: function(res){
console.log('跳转到news页面成功')// success
},
fail: function() {
console.log('跳转到news页面失败') // fail
},
complete: function() {
console.log('跳转到news页面完成') // complete
}
})
}
//下面是我记录的日志
跳转到news页面失败
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
没有别的日志了?
如果不是路径写错,把success,fail,complete这三个函数注释了试试,再看看有没有别的日志输出。
如果程序出错了,小程序的console面板都会输出很详细的报错信息的,你跟着上面的错误信息去改就行了。
你那个new页面注册了没
跳转的路径 不能是 tabBar路径,否则就是失败