docs: skip View Transitions API route middleware on server (#23935)

This commit is contained in:
Damian Głowala 2023-10-25 18:31:46 +02:00 committed by GitHub
parent 5fea172883
commit 6de4bcb75e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -428,7 +428,7 @@ If you are also using Vue transitions like `pageTransition` and `layoutTransitio
```js
export default defineNuxtRouteMiddleware(to => {
if (!document.startViewTransition) { return }
if (import.meta.server || !document.startViewTransition) { return }
// Disable built-in Vue transitions
to.meta.pageTransition = false