How to access html element inside a <q-dialog> ? #14726
-
|
I am trying to access a canvas html element, which is inside a q-dialog element, after onMounted(). However I cannot as the value I get on "myCanvas" variable is "null". Below is an excerpt of my code: If I take the canvas element somewhere outside the q-dialog tags I immediatelly get a value on myCanvas variable and I can work with it. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
Try to wrap the accessing of the template ref in a nextTick. |
Beta Was this translation helpful? Give feedback.
-
|
because if i'm not wrong the content of the dialog only added after opening the dialog otherwise it'll be removed from the dom |
Beta Was this translation helpful? Give feedback.
because if i'm not wrong the content of the dialog only added after opening the dialog otherwise it'll be removed from the dom
try to get it on dialog @show event