Improved default key for page with children

If a route being navigated to from a layout has children, I think this would be a better default key
This commit is contained in:
Daniel West 2017-07-29 18:10:04 +01:00 committed by GitHub
parent 8563c0f05f
commit 23ebb41353
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ export default {
routerViewKey () { routerViewKey () {
// If nuxtChildKey prop is given or current route has children // If nuxtChildKey prop is given or current route has children
if (typeof this.nuxtChildKey !== 'undefined' || this.$route.matched.length > 1) { if (typeof this.nuxtChildKey !== 'undefined' || this.$route.matched.length > 1) {
return this.nuxtChildKey || '' return this.nuxtChildKey || this.$route.fullPath.split('/')[1]
} }
return this.$route.fullPath.split('#')[0] return this.$route.fullPath.split('#')[0]
} }