Skip to content

Commit

Permalink
onPageNotFound with wx.switchTab
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongyuchen committed Mar 29, 2021
1 parent 5afed97 commit b57ed47
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ App({
})
},
onPageNotFound(res) {
wx.redirectTo({
// wx.redirectTo({
// url: 'pages/index/index'
// })
wx.switchTab({
url: 'pages/index/index'
}) // 如果是 tabbar 页面,请使用 wx.switchTab
})
},
globalData: {
userInfo: null
Expand Down

0 comments on commit b57ed47

Please sign in to comment.