Skip to content

Demonstrates the use of serverPrefetch, onMounted and router hooks to SSR data, hydrate it and update on route.

License

Notifications You must be signed in to change notification settings

seriouslysean/vue-3-ssr-fetchdata

Repository files navigation

Vue 3 SSR - fetchData

This repo uses two composables to show that serverPrefetch does not work as written in the Vue documentation. The way to fix it is to use Pinia and a store to persist the data. Additionally, it addresses the issue of clearing the data and refetching it when the route changes.