Kuroro
UPagination
Did you try this ?
I think useFetch is waiting for the reactive part of your variable
page
You don't need to use watch()
when you're using useFetch
because it's already looking for changes in his options (included params)
If you want to continue with a watch
solution, ensure the watch is triggered by logging something (and be sure that there's no warn/error logs)11 replies
search page dont work
i think we need to know your wanted behavior
My guess is :
- You can init the page with searched results through your query like : http://myurl.com?search=blablabla
- Each time you're writing something in the search bar, it triggers again a fetch method, and write the search result in the URL query part :
- So, if you type "product1" in the search bar
- Your query URL will be : http://myurl.com?search=product1
44 replies
Differents watch sources using useState
Ahah thanks! That's the first time I see this kind of trick.
It wouldn't be the best case in my opinion, because we're obliged to define each property of the object into different variables, It feels a bit hacky no?
Anyway, thanks for your time
As I said in my repro, I got it working too, but, i'm really looking for a technical explanation & why not, have an advice on the best way to go ! 🙂
36 replies
Differents watch sources using useState
Oh ok, I probably shouldn't do assignation here... Strapi API returns an object with two keys, trying to deal with it without wrapping my
useAsyncData
in a function... maybe should I ?
there's a minimal repro with a dummy API, but it reproduces my behavior : https://stackblitz.com/edit/nuxt-starter-cicj7t?file=components%2FTodosTable.vue
See comments in TodosTable.vue 🙂36 replies
Differents watch sources using useState
It's not. I'm maybe wrong, but i think useState is already returning a Ref, so i don't get it when you talk about specifying a ref/reactive in useState (make it nosense for me, but, once again, i'm maybe wrong)
And, if you find the docs page where it's specified, i would be happy to see it.
36 replies