mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
fix page transitions
This commit is contained in:
parent
e937937ea1
commit
2bf02731f2
@ -2,7 +2,7 @@
|
||||
<div id="__nuxt">
|
||||
<% if (loading) { %><nuxt-loading ref="loading"></nuxt-loading><% } %>
|
||||
<% if (layoutTransition) { %><transition name="<%= layoutTransition.name %>" mode="<%= layoutTransition.mode %>"><% } %>
|
||||
<component v-if="layout" :is="nuxt.err ? 'nuxt' : layout"></component>
|
||||
<component v-if="layout" :is="nuxt.err ? 'nuxt' : layout" :key="layoutName"></component>
|
||||
<% if (layoutTransition) { %></transition><% } %>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -43,9 +43,9 @@ export default {
|
||||
const layoutUid = parent._uid
|
||||
const layoutName = component.options ? component.options.layout : null
|
||||
|
||||
// If we're changing layout return the stored vnode
|
||||
// If we're changing layout render the stored vnode
|
||||
if (nuxt._layoutUid === layoutUid &&
|
||||
nuxt._layoutName !== layoutName) return nuxt._layoutVnode
|
||||
nuxt._layoutName !== layoutName) return nuxt._childVnode
|
||||
|
||||
nuxt._layoutUid = layoutUid
|
||||
nuxt._layoutName = layoutName
|
||||
@ -76,13 +76,13 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
nuxt._layoutVnode = h('transition', {
|
||||
nuxt._childVnode = h('transition', {
|
||||
props: transitionProps,
|
||||
on: listeners
|
||||
}, [
|
||||
h('router-view', data)
|
||||
])
|
||||
|
||||
return nuxt._layoutVnode
|
||||
return nuxt._childVnode
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<nuxt-error v-if="nuxt.err" :error="nuxt.err"></nuxt-error>
|
||||
<nuxt-child :key="routerViewKey" v-else></nuxt-child>
|
||||
<div class="nuxt">
|
||||
<nuxt-error v-if="nuxt.err" :error="nuxt.err"></nuxt-error>
|
||||
<nuxt-child :key="routerViewKey" v-else></nuxt-child>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
Loading…
Reference in New Issue
Block a user