Skip to content
Inkoxide

Search covers every page and heading of the docs. Use ↑ ↓ and ↵.

Serving templates

Edit this page

@inkoxide/vue/templates is the React guide's Serving templates for Vue: a template is { meta: { id }, schema, Template, images? }, whose Template is a component with the prop data.

import { generate, type TemplateLike } from '@inkoxide/vue/templates';
import { z } from 'zod';

import Invoice from './Invoice.vue'; // defineProps<{ data: { number: string; total: number } }>()

const schema = z.object({ number: z.string(), total: z.number() });
const invoice: TemplateLike<typeof schema> = { meta: { id: 'invoice' }, schema, Template: Invoice };

const { pdf } = await generate(invoice, { number: '2026-001', total: 120 });

Synced from packages/vue/GUIDE.md in the inkoxide repository.