Rename routerViewKey to nuxtChildKey

This commit is contained in:
Sébastien Chopin 2017-07-09 16:29:14 +02:00
parent fc2c780dd0
commit ad85582f5c
1 changed files with 6 additions and 6 deletions

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 :key="nuxtChildKey" v-else></nuxt-child> <nuxt-child :key="routerViewKey" v-else></nuxt-child>
</template> </template>
<script> <script>
@ -10,7 +10,7 @@ import NuxtError from '<%= components.ErrorPage ? ((components.ErrorPage.include
export default { export default {
name: 'nuxt', name: 'nuxt',
props: ['routerViewKey'], props: ['nuxtChildKey'],
beforeCreate () { beforeCreate () {
Vue.util.defineReactive(this, 'nuxt', this.$root.$options._nuxt) Vue.util.defineReactive(this, 'nuxt', this.$root.$options._nuxt)
}, },
@ -47,10 +47,10 @@ export default {
}, },
<% } %> <% } %>
computed: { computed: {
nuxtChildKey () { routerViewKey () {
// If routerViewKey prop is given or current route has children // If nuxtChildKey prop is given or current route has children
if (typeof this.routerViewKey !== 'undefined' || this.$route.matched.length > 1) { if (typeof this.nuxtChildKey !== 'undefined' || this.$route.matched.length > 1) {
return this.routerViewKey || '' return this.nuxtChildKey || ''
} }
return this.$route.fullPath.split('#')[0] return this.$route.fullPath.split('#')[0]
} }