update: Use path by default or Page.key

This commit is contained in:
Atinux 2017-11-06 18:29:45 +01:00
parent 1f6d89b2e9
commit e80a77782a

View File

@ -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: {