From e80a77782af1369923617cd4c70d7ea3f8d872b5 Mon Sep 17 00:00:00 2001 From: Atinux Date: Mon, 6 Nov 2017 18:29:45 +0100 Subject: [PATCH] update: Use path by default or Page.key --- lib/app/components/nuxt.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/app/components/nuxt.js b/lib/app/components/nuxt.js index 068b1b16e5..f0bad06587 100644 --- a/lib/app/components/nuxt.js +++ b/lib/app/components/nuxt.js @@ -29,7 +29,11 @@ export default { if (typeof this.nuxtChildKey !== 'undefined' || this.$route.matched.length > 1) { return this.nuxtChildKey || compile(this.$route.matched[0].path)(this.$route.params) } - return this.$route.fullPath.split('#')[0] + const Component = this.$route.matched[0].components.default + if (Component && Component.options && Component.options.key) { + return (typeof Component.options.key === 'function' ? Component.options.key(this.$route) : Component.options.key) + } + return this.$route.path } }, components: {