T
TanStack3y ago
wise-white

Refetch Query when variable change (VUE)

i have 2 pages: 1. BaseInputSearchResults.vue: 2. useLp.ts (Vue/query hook) im trying to call the query everytime the searchValue is changes with the new value, but it not works for some reason. i did a thing like this with react/query and i was very easy with useState, i thought it will be like this with ref in vue, but ut seems that not. how to fix it , please help
No description
No description
1 Reply
quickest-silver
quickest-silver3y ago
You need to pass the actual ref searchValue and not the .value of it to the queryKey. Then you can use searchValue.value in your lpService.getPlatesByNumber call or unref(searchValue)

Did you find this page helpful?