I am looking to implement a mixin for setting the header and meta data in my project. I recently discovered vue-meta, which seems to work really well for this purpose. However, I am still getting acquainted with TypeScript and class-based components.
How can I access the class member pageTitle
within the component properties of metaInfo()
?
Here is some sample code:
import Vue from 'vue';
import { Component } from 'vue-property-decorator';
@Component({
metaInfo() {
return {
title: pageTitle, // Here I want to retrieve the class member
};
},
})
export default class headerMixin extends Vue {
pageTitle: string = 'Page Title'; // Defining the class member
}