Vue query syntax without destructuring #7356
Unanswered
lucas-santosP
asked this question in
Q&A
Replies: 1 comment
-
Just wanted to say thank you for making this post. I couldn't figure out why I couldn't use the query without destructuring until I found this. I agree, it's quite confusing and if there's any way possible to resolve this it would be a great addition. |
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
-
Is it possible to access the values returned by
useQuery
in Vue without resorting to destructuring and without needing to use.value
in the template?Example of what I'm doing right now, which requires
.value
in the template:script:
template:
I know I could use destructuring and access data, isFetching and error individually. But in a component with multiple queries, this is impracticable because of name collisions. And renaming each of these values with something like isFetchingParametrization, errorParametrization, dataParametrization... would not be a good syntax and is too verbose.
So the best solution is a wrapper object and it makes more sense semantically, but the need of
.value
inside the template is annoying and discordant from the rest of the usual reactive code. There's any way to fix that?Beta Was this translation helpful? Give feedback.
All reactions