const Component = require(`vn-print/core/component`); const emailBody = new Component('email-body'); const attachment = new Component('attachment'); module.exports = { name: 'balance-compensation', async serverPrefetch() { this.client = await this.fetchClient(this.id); }, methods: { fetchClient(id) { return this.findOneFromDef('client', [id]); }, }, components: { 'email-body': emailBody.build(), 'attachment': attachment.build() }, data() { return { attachments: [ { filename: 'balance-compensation.pdf', type: 'pdf', path: `Receipts/${this.id}/balance-compensation-pdf` } ] }; }, props: { id: { type: Number, required: true } } };