mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-19 23:21:09 +00:00
fix: Fix Cannot read property 'components' of undefined
This commit is contained in:
parent
ece3fe84dc
commit
4b79c38f41
@ -29,7 +29,7 @@ export default {
|
|||||||
if (typeof this.nuxtChildKey !== 'undefined' || this.$route.matched.length > 1) {
|
if (typeof this.nuxtChildKey !== 'undefined' || this.$route.matched.length > 1) {
|
||||||
return this.nuxtChildKey || compile(this.$route.matched[0].path)(this.$route.params)
|
return this.nuxtChildKey || compile(this.$route.matched[0].path)(this.$route.params)
|
||||||
}
|
}
|
||||||
const Component = this.$route.matched[0].components.default
|
const Component = this.$route.matched[0] && this.$route.matched[0].components.default
|
||||||
if (Component && Component.options && Component.options.key) {
|
if (Component && Component.options && Component.options.key) {
|
||||||
return (typeof Component.options.key === 'function' ? Component.options.key(this.$route) : Component.options.key)
|
return (typeof Component.options.key === 'function' ? Component.options.key(this.$route) : Component.options.key)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user