From 37c3d5433db6c19d65532fac39674be286690d54 Mon Sep 17 00:00:00 2001 From: Daniel West Date: Tue, 1 Aug 2017 14:16:23 +0100 Subject: [PATCH] Improvements by @Atinux https://github.com/nuxt/nuxt.js/pull/1209#issuecomment-319362924 --- lib/app/components/nuxt.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/app/components/nuxt.vue b/lib/app/components/nuxt.vue index 2ecf85304f..45629f1ede 100644 --- a/lib/app/components/nuxt.vue +++ b/lib/app/components/nuxt.vue @@ -7,6 +7,7 @@ import Vue from 'vue' import NuxtChild from './nuxt-child' import NuxtError from '<%= components.ErrorPage ? ((components.ErrorPage.includes('~') || components.ErrorPage.includes('@')) ? components.ErrorPage : "../" + components.ErrorPage) : "./nuxt-error.vue" %>' +import { compile } from '~/.nuxt/utils' export default { name: 'nuxt', @@ -50,7 +51,7 @@ export default { routerViewKey () { // If nuxtChildKey prop is given or current route has children if (typeof this.nuxtChildKey !== 'undefined' || this.$route.matched.length > 1) { - return this.nuxtChildKey || this.$route.fullPath.split('/')[1] + return this.nuxtChildKey || compile(this.$route.matched[0].path)(this.$route.params) } return this.$route.fullPath.split('#')[0] }