uniapp 在onLaunch中跳转页面后,点击事件失效解决方法

在onLaunch中重定向会导致点击事件失效的问题

解决方法:

1、在跳转的函数加一个setTimeout,但是会导致有时setTimeout函数内的跳转失败

onLaunch() {
  setTimeout(() => {
      uni.reLaunch({
          url: '/pages/user/user'
      })
  }, 0)
}

2、在新跳转的页面的onLoad中编写自己的逻辑

猜你喜欢

转载自blog.csdn.net/qq_48469083/article/details/124973705