From 6461bcc9cb4c1ba16a54e6a23259fc61e9e179d4 Mon Sep 17 00:00:00 2001 From: Sebastien Chopin Date: Fri, 18 Aug 2017 15:44:34 +0200 Subject: [PATCH] Add appear transition on spa mode --- lib/app/components/nuxt-child.js | 12 ++++++++++-- lib/common/options.js | 8 +++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/app/components/nuxt-child.js b/lib/app/components/nuxt-child.js index 492e002ac8..39b8e3c4e7 100644 --- a/lib/app/components/nuxt-child.js +++ b/lib/app/components/nuxt-child.js @@ -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 { diff --git a/lib/common/options.js b/lib/common/options.js index 83b8755b98..c06b4d179a 100755 --- a/lib/common/options.js +++ b/lib/common/options.js @@ -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',