Open boogiefromzk opened 2 years ago
Here are discussions: https://github.com/vuejs/vue-router/issues/1144 https://github.com/vuejs/vue/issues/7209 https://github.com/vuejs/pinia/discussions/988 There are cases where you need some data fetched before other components are initialized (mount hook called), for example authentication checked or user data fetched. Currently need to use watches, which might be multiple, instead of a simple mounted hook in child components.
Just the same as serverPrefetch, but on client.
Can't this be achieved by using the async setup and Suspense? Or by using the navigation guards from vue-router?
async setup
Suspense
What problem does this feature solve?
Here are discussions: https://github.com/vuejs/vue-router/issues/1144 https://github.com/vuejs/vue/issues/7209 https://github.com/vuejs/pinia/discussions/988 There are cases where you need some data fetched before other components are initialized (mount hook called), for example authentication checked or user data fetched. Currently need to use watches, which might be multiple, instead of a simple mounted hook in child components.
What does the proposed API look like?
Just the same as serverPrefetch, but on client.