Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

shared-form.ts

21 lines427 Bytes

1import { formOptions } from '@tanstack/vue-form'
2import z from 'zod'
3​
4export const step1Schema = z.object({
5 name: z.string().min(2, 'Name must be at least 2 characters'),
6})
7​
8export const step2Schema = z.object({
9 name: z.string().min(3, 'Name must be at least 3 characters'),
10})
11​
12export const wizardFormOpts = formOptions({
13 defaultValues: {
14 step1: {
15 name: '',
16 },
17 step2: {
18 name: '',
19 },
20 },
21})