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 = [ 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 {

View File

@ -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',