问题模块 | 框架类型 | 问题类型 | 操作系统 | 工具版本 |
---|---|---|---|---|
开发者工具 | 小程序 | Bug | Windows | 1.02.1812271 |
在app.js里面定义
navigateTo(x) {
switch(x) {
case 6: console.log(x)
wx.switchTab({
url: '/pages/home/home'
})
break
default:
break
}
} 在onLaunch()里面this.navigateTo(6)调用这段代码,只有重启项目才跳转,调试刷新有打印出6但是跳转不了(程序入口是登录页,pages/home/home是首页在app.json里面有定义tabBar)
网友回复
那个很帅的小白:
麻烦按照教程提供下代码片段:https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html