-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
使用v-if渲染的组件内部watch受到其他v-show组件逻辑影响,导致watch触发行为异常 #9761
Comments
tanks |
This is expected behavior, because watchers by default fire before render updates: https://vuejs.org/guide/essentials/watchers.html#callback-flush-timing If you don't want it to fire, use a post-flush watcher. |
In the example code, Is inconsistent performance between using and not using v-show an expected behavior? |
Closing as duplicate of #7030 |
Vue version
3.3.10
Link to minimal reproduction
https://link.juejin.cn/?target=https%3A%2F%2Fgitee.com%2Fsqlyr%2Fvue-watch
Steps to reproduce
1、点击显示按钮
2、点击隐藏按钮
3、查看控制台输出
What is expected?
此处watch不触发
What is actually happening?
watch会错误触发
且使用注释中的写法不会触发该错误
System Info
No response
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: