const Component = require(`vn-print/core/component`); const reportBody = new Component('report-body'); module.exports = { name: 'zone', async serverPrefetch() { this.zone = await this.fetchZone(this.id); if (!this.zone) throw new Error('Something went wrong'); }, methods: { fetchZone(id) { return this.findOneFromDef('zone', [id]); } }, components: { 'report-body': reportBody.build() }, props: { id: { type: Number, required: true, description: 'The zone id' } } };