mirror of https://github.com/sveltejs/svelte
parent
c85d6a657a
commit
cac6134428
@ -0,0 +1,16 @@
|
||||
<script>
|
||||
import { onNavigate } from '$app/navigation';
|
||||
|
||||
onNavigate((navigation) => {
|
||||
if (!document.startViewTransition) return;
|
||||
|
||||
return new Promise((resolve) => {
|
||||
document.startViewTransition(async () => {
|
||||
resolve();
|
||||
await navigation.complete;
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<slot />
|
||||
Loading…
Reference in new issue