Add appear transition on spa mode

This commit is contained in:
Sebastien Chopin 2017-08-18 15:44:34 +02:00
parent 1507061138
commit 6461bcc9cb
2 changed files with 17 additions and 3 deletions

View File

@ -3,16 +3,20 @@ import Vue from 'vue'
const transitionsKeys = [
'name',
'mode',
'appear',
'css',
'type',
'duration',
'enterClass',
'leaveClass',
'appearClass',
'enterActiveClass',
'enterActiveClass',
'leaveActiveClass',
'appearActiveClass',
'enterToClass',
'leaveToClass'
'leaveToClass',
'appearToClass'
]
const listenersKeys = [
'beforeEnter',
@ -22,7 +26,11 @@ const listenersKeys = [
'beforeLeave',
'leave',
'afterLeave',
'leaveCancelled'
'leaveCancelled',
'beforeAppear',
'appear',
'afterAppear',
'appearCancelled'
]
export default {

View File

@ -133,6 +133,11 @@ Options.from = function (_options) {
// Apply mode
_.defaultsDeep(options, mode)
// If no server-side rendering, add appear true transition
if (options.render.ssr === false) {
options.transition.appear = true
}
return options
}
@ -239,7 +244,8 @@ Options.defaults = {
loadingIndicator: {},
transition: {
name: 'page',
mode: 'out-in'
mode: 'out-in',
appear: false
},
router: {
mode: 'history',