3
I haven’t recorded it for a long time (updated today). When using uniapp to compile into a small program, redirecting in onLaunch will cause the click event to become invalid. However, if you redirected the page using the navigator component to jump and then return, click The event is valid again, there is no problem redirecting in the native WeChat applet

Redirection fails in onLaunch

onLaunch() {
    uni.reLaunch({
        url: '/pages/user/user'
    })
}
  • Solution

    onLaunch() {
      setTimeout(() => {
          uni.reLaunch({
              url: '/pages/user/user'
          })
      }, 0)
    }
  • After using the delay, it will not appear
I am studying hard, if it is helpful to your study, leave your mark (please like it^_^)

小小蚊子
5.1k 声望285 粉丝

不努力,就不知道前面有多精彩