mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
nuxt-child styling
This commit is contained in:
parent
991d5f70ea
commit
b6f2405e7e
@ -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'
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user