-
-
Notifications
You must be signed in to change notification settings - Fork 33.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
[2.7.7] Array of template refs are not watchable #12675
Comments
refs
are not watchable
refs
are not watchableref([])
) are not watchable
ref([])
) are not watchable
Were you using This behavior is aligned with Vue 3 - when you directly watch a ref, the watcher only fires when its Typically, the recommended way to react to array refs change is using |
Hi @yyx990803, thank you so much for the detailed reply. I'm actually using This occurred when I attempted to update https://showcode.app using My The refs that are being watched that previously worked fine:
I'll try your suggestion with |
I just tried it and this works with |
It is also solve my confusion after updating from 2.6 (with @vue/composition-api) to 2.7. Thanks |
Version
2.7.7
Reproduction link
codesandbox.io
Steps to reproduce
Create a
const els = ref([])
to store an array of HTML elements in a v-for. Attempt towatch(els)
. Nothing happens.This worked in 2.6.*.
What is expected?
The watcher function should fire anytime the ref has changed with new elements added in a v-for.
What is actually happening?
The watcher function is not firing.
The text was updated successfully, but these errors were encountered: