Transition properties
Set the default properties of the page and layout transitions.
The pageTransition Property
Nuxt v2.7.0 introduces key "pageTransition" in favor of the "transition" key to consolidate the naming with layout transition keys.
-
Type:
String
orObject
Used to set the default properties of the page transitions.
Default:
{
name: 'page',
mode: 'out-in'
}
nuxt.config.js
export default {
pageTransition: 'page'
// or
pageTransition: {
name: 'page',
mode: 'out-in',
beforeEnter (el) {
console.log('Before enter...');
}
}
}
The transition key in nuxt.config.js
is used to set the default properties for the page transitions. To learn more about the available keys when the transition
key is an object, see the pages transition property .
The layoutTransition Property
-
Type:
String
orObject
Used to set the default properties of the layout transitions. The value provided in the
name
option is configured to work with the name provided inlayout
from yourlayouts
folder.
Default:
{
name: 'layout',
mode: 'out-in'
}
nuxt.config.js
export default {
layoutTransition: 'layout'
// or
layoutTransition: {
name: 'layout',
mode: 'out-in'
}
}
assets/main.css
.layout-enter-active,
.layout-leave-active {
transition: opacity 0.5s;
}
.layout-enter,
.layout-leave-active {
opacity: 0;
}
Edit this page on GitHub
Updated at Thu, Feb 9, 2023
Paiva
Florian Reuschel
Sébastien Chopin
Daniel Roe
Rishi Raj Jain
Clément Ollivier
Savas Vedova
Steven Soekha
Vinícius Alves
Kareem Dabbeet
Valentín Costa
Ryan Skinner
Alex Hirzel
Ajeet Chaulagain
René Eschke
Nico Devs
Muhammad
Nazaré da Piedade
Naoki Hamada
Tom
Yann Aufray
Anthony Chu
Nuzhat Minhaz
Lucas Portet
Richard Schloss
bpy
Antony Konstantinidis
Hibariya
Jose Seabra
Eze
Florian LEFEBVRE
Lucas Recoaro
Julien SEIXAS
Hugo
Sylvain Marroufin
Spencer Cooley
Piotr Zatorski
Vladimir Semenov
Harry Allen
kazuya kawaguchi
Unai Mengual
Hyunseung Lee
Alexandre Chopin
pooya parsa
Nick Medrano
Mosaab Emam
Iljs Путлер Капут
Heitor Ramon Ribeiro
Nero
Yoon Han
Ikko Eltociear Ashimine
FamCodings
Ayouli
F. Hinkelmann
felipesuri
Christophe Carvalho Vilas-Boas
Leoš Literák
Trizotti