diff --git a/lib/app/components/nuxt-child.js b/lib/app/components/nuxt-child.js index 8df1feb71d..8d89530719 100644 --- a/lib/app/components/nuxt-child.js +++ b/lib/app/components/nuxt-child.js @@ -1,38 +1,3 @@ -import Vue from 'vue' - -const transitionsKeys = [ - 'name', - 'mode', - 'appear', - 'css', - 'type', - 'duration', - 'enterClass', - 'leaveClass', - 'appearClass', - 'enterActiveClass', - 'enterActiveClass', - 'leaveActiveClass', - 'appearActiveClass', - 'enterToClass', - 'leaveToClass', - 'appearToClass' -] -const listenersKeys = [ - 'beforeEnter', - 'enter', - 'afterEnter', - 'enterCancelled', - 'beforeLeave', - 'leave', - 'afterLeave', - 'leaveCancelled', - 'beforeAppear', - 'appear', - 'afterAppear', - 'appearCancelled' -] - export default { name: 'nuxt-child', functional: true, @@ -45,7 +10,10 @@ export default { // If we're changing layout render the stored vnode if (nuxt._layoutUid === layoutUid && - nuxt._layoutName !== layoutName) return nuxt._childVnode + nuxt._layoutName !== layoutName + ) { + return nuxt._childVnode + } nuxt._layoutUid = layoutUid nuxt._layoutName = layoutName @@ -62,6 +30,7 @@ export default { parent = parent.$parent } data.nuxtChildDepth = depth + const transition = transitions[depth] || defaultTransition let transitionProps = {} transitionsKeys.forEach((key) => { @@ -86,3 +55,37 @@ export default { return nuxt._childVnode } } + +const transitionsKeys = [ + 'name', + 'mode', + 'appear', + 'css', + 'type', + 'duration', + 'enterClass', + 'leaveClass', + 'appearClass', + 'enterActiveClass', + 'enterActiveClass', + 'leaveActiveClass', + 'appearActiveClass', + 'enterToClass', + 'leaveToClass', + 'appearToClass' +] + +const listenersKeys = [ + 'beforeEnter', + 'enter', + 'afterEnter', + 'enterCancelled', + 'beforeLeave', + 'leave', + 'afterLeave', + 'leaveCancelled', + 'beforeAppear', + 'appear', + 'afterAppear', + 'appearCancelled' +]