const Component = require(`${appPath}/core/component`); const emailHeader = new Component('email-header'); const emailFooter = new Component('email-footer'); module.exports = { name: 'invoice', async serverPrefetch() { this.invoice = await this.fetchInvoice(this.refFk); }, methods: { fetchInvoice(refFk) { return this.findOneFromDef('invoice', [refFk]); }, }, components: { 'email-header': emailHeader.build(), 'email-footer': emailFooter.build() }, props: { refFk: { type: [Number, String], required: true } } };