I am currently facing a weird issue with NuxtJS.
After creating a mixing for a component I can access / print a field from the components data.
export default () => {
return {
head () {
console.log(this.story)
}
}
}
Works fine.
But after I try to access the object story
itself, it becomes undefined.
export default () => {
return {
head () {
console.log(this.story)
const title = this.story.content.title
console.log(title)
}
}
}
Cannot read property 'content' of undefined
The log statement of this.story
is then undefined too.
The component where I registered this mixin makes use of another one with return the story
data field.
export default{
name: 'Default',
components: {Page},
mixins: [
FetchData({
preview: false
}),
addMetaTags()
]
}
Did I miss something?