Turbo Tutorial | Nuxt 3: Query from an external API + read more
Вставка
- Опубліковано 7 вер 2024
- Learn how to query an external API and how to implement "read more" functionality.
Find the code for this tutorial here: github.com/Tur...
Visit turbo-tutorial... for more info.
Browse more tutorials here: turbo-tutorial...
Great work, those turbo tuts really helping me to learn nuxt, resources for nuxt 3 are limited...
Hi! Thanks for this! How can i avoid doing the reload of data when navigating back to such a list component. For example if you had a detail page for each talk to at eg. /talks/{id} and then you hit the back button to list the talks, it reloads again with limit 2 right? I have a case where i want to load paginated data based on a filter with a details page to each element. Unfortunately all filters and data is reset after returning from the details page. Do i have to use external state management libs for this already?
In Nuxt 3 you can add a key as cache to your data fetch call. When you go back to the list page Nuxt should render the talks from the cache.
@@timbenniks Thanks for the response! Hmm but the filter refs always seem to reset when navigating back thus triggering a reload because i am watching the filters. I seem to have some fundamental gaps of understanding the whole framework... how can i keep ref values persist through route navigation. I tried keepalive on the page meta info but that does not seem to do it.
Interesting. Reach out on Twitter at @timbenniks, I’ll put you in touch with Nuxt core team members.
how can i sort this data?