Cannot use suspense with subpages - subpage leaves too soon #1833
Unanswered
chojnicki
asked this question in
Help and Questions
Replies: 1 comment 1 reply
-
I'm running into the same problem, using vue v3.4.5 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Someone is using Router + Suspense (vue 3), with nested (child) routes?
While switching between pages it works as expected, like in standard SSR - old page is kept until new (with fetched data) is resolved, then there is transition between, great. But if on old page there is nested another router-view (nested child pages), that nested page just disappears while changing root page, and I'm watching blank space until new page is ready :/ So nested Suspense is not "waiting" for root Suspense.
Any workaround? Hope I explained this clear enough. There is not much code to share, it looks like in docs https://vuejs.org/guide/built-ins/suspense.html#combining-with-other-components similar code both in root router view and in child router view.
Edit: Here is reproduction https://stackblitz.com/edit/vitejs-vite-gg6kqo?file=src/pages/demo/demo1.vue
Just click on link to demo page, and then back to home page. Before home page is loaded, content of nested route in demo page disapears. I want to keep it, just like it is while switching between "home" and "about".
PS fallback is used only on init. In real app, my indicator that page is loading is nprogress.
Edit: Here is also question on stackoverflow https://stackoverflow.com/questions/76185240/suspense-in-vue-3-on-nested-routes-why-content-disappears
Beta Was this translation helpful? Give feedback.
All reactions