-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Refs were broken between alpha.4 and alpha.5 #772
Comments
Do note in alpha.4 it leads to an infinite loop warning. This is because the ref was referenced as a dependency for the render and mutated (from The fact that a template ref is |
@yyx990803 The problem is... it just doesn't work. This was a simple repro, but my intent is to access the DOM element in a This examples paints a canvas: |
Eager watchers now fire synchronously (this is necessary to make them work inside Suspense trees and for server rendering). To make the initial run be able to access template refs, wrap them in onMounted(() => {
watchEffect(() => {
// can access DOM now
})
}) |
OK, will try. Which makes me wonder: what is the precise rule? When can I start a |
@jods4 |
@yyx990803 seems to work in simple cases. EDIT: I thought that it might be related to #766 but it doesn't seem to fix it. |
I think it never worked inside slots - that's a separate issue though. For now you can use a function ref to get around that: <v-comp>
<div :ref="el => (y = el)"></div>
</v-comp> |
Shall I open an issue for that? |
It's been fixed in 3eab143 |
Version
3.0.0-alpha.6
Reproduction link
https://codesandbox.io/s/v-model-decomposed-camel-case-s05q5
Steps to reproduce
Just open the repro, nothing to do.
What is expected?
Ref should be set to DOM element (-> Page says Ref works).
What is actually happening?
Ref stays null (-> Page says Ref doesn't work).
This a regression that happened between alpha.4 and alpha.5, as can be seen by changing the script source in repro.
The text was updated successfully, but these errors were encountered: