4

#yyds干货盘点#uniapp 在onLaunch中使用redirectTo或reLaunch跳转页面后点击事件失效

 2 years ago
source link: https://blog.51cto.com/u_11365839/5614171
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

好久没有记录了(今天更新下),使用uniapp编译成小程序时,在onLaunch中重定向会导致点击事件失效,但是,如果,你重定向的页面中有使用navigator组件跳转后再返回,点击事件又有效了,在原生微信小程序中重定向没有问题

onLaunch中重定向失效

onLaunch() {
uni.reLaunch({
url: '/pages/user/user'
})
}
onLaunch() {
setTimeout(() => {
uni.reLaunch({
url: '/pages/user/user'
})
}, 0)
}
  • 使用延迟后,则不会出现

正在努力学习中,若对你的学习有帮助,留下你的印记呗(点个赞咯^_^)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK