mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
Add appear transition on spa mode
This commit is contained in:
parent
1507061138
commit
6461bcc9cb
@ -3,16 +3,20 @@ import Vue from 'vue'
|
|||||||
const transitionsKeys = [
|
const transitionsKeys = [
|
||||||
'name',
|
'name',
|
||||||
'mode',
|
'mode',
|
||||||
|
'appear',
|
||||||
'css',
|
'css',
|
||||||
'type',
|
'type',
|
||||||
'duration',
|
'duration',
|
||||||
'enterClass',
|
'enterClass',
|
||||||
'leaveClass',
|
'leaveClass',
|
||||||
|
'appearClass',
|
||||||
'enterActiveClass',
|
'enterActiveClass',
|
||||||
'enterActiveClass',
|
'enterActiveClass',
|
||||||
'leaveActiveClass',
|
'leaveActiveClass',
|
||||||
|
'appearActiveClass',
|
||||||
'enterToClass',
|
'enterToClass',
|
||||||
'leaveToClass'
|
'leaveToClass',
|
||||||
|
'appearToClass'
|
||||||
]
|
]
|
||||||
const listenersKeys = [
|
const listenersKeys = [
|
||||||
'beforeEnter',
|
'beforeEnter',
|
||||||
@ -22,7 +26,11 @@ const listenersKeys = [
|
|||||||
'beforeLeave',
|
'beforeLeave',
|
||||||
'leave',
|
'leave',
|
||||||
'afterLeave',
|
'afterLeave',
|
||||||
'leaveCancelled'
|
'leaveCancelled',
|
||||||
|
'beforeAppear',
|
||||||
|
'appear',
|
||||||
|
'afterAppear',
|
||||||
|
'appearCancelled'
|
||||||
]
|
]
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -133,6 +133,11 @@ Options.from = function (_options) {
|
|||||||
// Apply mode
|
// Apply mode
|
||||||
_.defaultsDeep(options, mode)
|
_.defaultsDeep(options, mode)
|
||||||
|
|
||||||
|
// If no server-side rendering, add appear true transition
|
||||||
|
if (options.render.ssr === false) {
|
||||||
|
options.transition.appear = true
|
||||||
|
}
|
||||||
|
|
||||||
return options
|
return options
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +244,8 @@ Options.defaults = {
|
|||||||
loadingIndicator: {},
|
loadingIndicator: {},
|
||||||
transition: {
|
transition: {
|
||||||
name: 'page',
|
name: 'page',
|
||||||
mode: 'out-in'
|
mode: 'out-in',
|
||||||
|
appear: false
|
||||||
},
|
},
|
||||||
router: {
|
router: {
|
||||||
mode: 'history',
|
mode: 'history',
|
||||||
|
Loading…
Reference in New Issue
Block a user