Replies: 1 comment
-
Edit: I found an interesting way of abstracting this implementation with a This way we can just update a value, and the transition will start before the Vue dependency system is actually triggered:
We can also do the same with computed:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
TL;DR: demo (needs Chromium based browser according to current support)
I recently played a bit with the new
document.startViewTransition()
API. Seems like the simplest is to use a generic hook from vue-routeronBeforeRouteUpdate
:But if one wants to transition when a single prop or ref updates, we have to hack a bit by using an intermediary value:
This is a bit verbose, and might need 2 renders if the original prop is used in the template.
It would be super easy to delay the rendering if some kind of
next
was possible with theonBeforeUpdate
component hook:What do you think?
I may have missed a simpler way of doing it though!
Beta Was this translation helpful? Give feedback.
All reactions