作者: 文章来源:
本文原地址:https://www.mimiwuqi.com/webqianduan/196601.html
使用 uniapp 编译成小程序时,在onLaunch中重定向会导致点击事件失效,但是,如果,你重定向的页面中有使用navigator组件跳转后再返回,点击事件又有效了,在原生微信小程序中重定向没有问题。
onLaunch() {
uni.reLaunch({
url: '/pages/user/user'
})
}
解决办法:
onLaunch() {
setTimeout(() => {
uni.reLaunch({
url: '/pages/user/user'
})
}, 0)
}
使用延迟后,则不会出现。
更多 建站教程 请访问 https://www.mimiwuqi.com/webqianduan/