Merge pull request #1022 from silverbackdan/silverbackdan-vue-router-key

Configurable 'key' attribute/property for transitions
This commit is contained in:
Sébastien Chopin 2017-07-08 12:57:52 +02:00 committed by GitHub
commit f490652d18

View File

@ -1,6 +1,6 @@
<template> <template>
<nuxt-error v-if="nuxt.err" :error="nuxt.err"></nuxt-error> <nuxt-error v-if="nuxt.err" :error="nuxt.err"></nuxt-error>
<nuxt-child v-else></nuxt-child> <nuxt-child :key="routerViewKey" v-else></nuxt-child>
</template> </template>
<script> <script>
@ -10,6 +10,7 @@ import NuxtError from '<%= components.ErrorPage ? ((components.ErrorPage.include
export default { export default {
name: 'nuxt', name: 'nuxt',
props: ['routerViewKey'],
beforeCreate () { beforeCreate () {
Vue.util.defineReactive(this, 'nuxt', this.$root.$options._nuxt) Vue.util.defineReactive(this, 'nuxt', this.$root.$options._nuxt)
}, },