const Component = require(`vn-print/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.ref); }, methods: { fetchInvoice(ref) { return this.findOneFromDef('invoice', [ref]); }, }, components: { 'email-header': emailHeader.build(), 'email-footer': emailFooter.build() }, props: { ref: { type: [Number, String], required: true } } };