Delay client routing (until transition is complete) #633
Unanswered
lutzissler
asked this question in
Help & Questions
Replies: 1 comment 5 replies
-
You can't delay the rendering process start, but you can delay the actual Vue rendering (just sleep in your client-side If you can create a convincing UX story around it, I may consider a feature request. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First, thanks for building vite-plugin-ssr! It’s a relief not having to jump on that big Nuxt.js tanker for getting some SSR done.
I am building a Vue app/website and using
clientRouting = true
. My app is using page transitions which take a (small) while. Half of the transition/animation should happen on the old page, then the navigation should occur, and then the other half of the transition should happen on the new page. Hence what is needed is a way to delay the actual routing.In vue-router, this can be done with a ‘global before guard’ (see https://router.vuejs.org/guide/advanced/navigation-guards.html#global-before-guards), which can be an
async
function or allows to return a Promise. If used that way, the navigation will only occur when the Promise resolves totrue
. In other words, I can simply do this:…and the actual routing will be delayed by 150ms.
Is there any way to achieve this with client routing in vite-plugin-ssr?
Beta Was this translation helpful? Give feedback.
All reactions