Watching clientX/clientY values as PROPS only work when mouse moves alongside the x-achsis #11934
Unanswered
DevKame
asked this question in
Help/Questions
Replies: 1 comment
-
You are misreading your own console logs.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Im using <script setup> with Vue 3 with Typescript
My parentComponent ButtonWrapper.vue contains two PrimButton.vue Components. Depending on the mousemovement within ButtonWrapper.vue i am going to manipulate the Background-images of my PrimButtons. For that i need to identify the mouseposition when moving the mouse over ButtonWrapper.
ButtonWrapper.vue:
PrimButton.vue:
What is confusing is the fact that as long as i move my mouse alongside the x achsis, it works:
But as soon as i move the mouse alongside the y achsis, both values become undefined:
Why is that? What did i do wrong?
EDIT: I just corrected the wrong syntax in the callbackfunction in the watch function. But still with the same result, only that, when i move alongside the x axis, the values for cy are undefined and if i move alongside the y axis, vice versa:
EDIT2": I switched to using Provide/Inject but just to be able to keep working. It should also be possible to do that with props, dont you think?
Beta Was this translation helpful? Give feedback.
All reactions