Open komninoschatzipapas opened 3 years ago
@komninoschat You can use it by specifying this
as a parameter for the head
.
Using your example it will look this way:
import { Component, Vue } from 'nuxt-property-decorator';
@Comonent({
head(this: Comp) { return { title: this.title } },
asyncData(ctx) {
// Calculate title dynamically
return { title: 'abc' }
}
})
export default Comp extends Vue {
title!: string;
}
I have a component that calculates the page title on
asyncData
. It looks like this:But I get an error while trying to access
this
insidehead
:Is it possible to achieve this functionality? If yes, how exactly?