-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
ues ref on dom element will not trigger watch or watchEffect #2456
Comments
is there any side effects if we
this code passed all test |
Do this: watchEffect(() => ..., { flush: 'post' }) |
Yeah, I know, but the implemention is confusing so it still need to talk if this is as expected or not. |
You can find more info in existing issues like #1706 |
@posva |
Version
3.0.2
Reproduction link
https://jsfiddle.net/h8k7rp45/1/
Steps to reproduce
just click the text
Hello Vuejs
, then look at the console, it will outputundefined
once, then after 1 second, outputhehe0
. If I remove thesetTimeout
, thehehe0
will never outputWhat is expected?
output
hehe0
when CompA mountedWhat is actually happening?
not output
hehe0
when CompA mountedit mainly because watch & watchEffect push
preJobs
, andref.value = element
worked atqueue jobs
(the middle), when pushpreJobs
, it's still flushing, so it will not flush again. And after postEffects, noqueue jobs
andpostEffects
add, it won't runpreJobs
again.The text was updated successfully, but these errors were encountered: