-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【微信小程序】Vue3版本dom变化导致事件回调错乱 #5307
Comments
hello ,我这里运行你的代码,尝试过很多次,点击红字都没有触发过 CB3 回调。还请你再详细说明一下问题。 |
你是用的哪个版本的uni-app? |
3.0.0-4040520250104002,刚试了一下在这个最新版本也是可以复现的,多点几次,点快一点 |
忘了说明了,是微信小程序 |
+1,遇到同样的问题 |
感谢反馈,能够复现,具体问题还需要排查,暂时推荐使用 v-show 替代 |
感觉是事件底层顺序机制的问题,如果事件跨越两次渲染就会有问题,目前我们采用了patch的方法,在vOn编译的时候全局计数生成编号,然后在事件名中附加这一编号,能临时解决这个问题 |
Vue3版本的事件回调是按顺序命名的,如果有v-if这些引起结构变化的场景,会导致两次渲染同一个命名的回调绑定到不同的回调函数上面,如果事件跨跃了这次渲染就会分发错误。
以下是复现代码,快速点击按钮会有概率回调到CB3:
The text was updated successfully, but these errors were encountered: