passing props to vue 3 composable isn't reactive #10106
Answered
by
LinusBorg
inthegreenwild
asked this question in
Help/Questions
-
I'm trying to pass a component prop to a composable and in the composable is a computed based on one of the component props. For some reason, the computed function is never called when the prop changes. Is there a correct way of doing this in the composition api?
and the composable:
stackblitz example: https://stackblitz.com/edit/github-yfh8fb-xaspss?file=composables%2Fa.js |
Beta Was this translation helpful? Give feedback.
Answered by
LinusBorg
Jan 13, 2024
Replies: 1 comment 1 reply
-
What you would need is |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
inthegreenwild
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
aProp
is a ref, soaProp === ''
will always be false.What you would need is
aProp.value === ''