diff --git a/playground/components/FormElementsExample.vue b/playground/components/FormElementsExample.vue index 27a5b569..6954927e 100644 --- a/playground/components/FormElementsExample.vue +++ b/playground/components/FormElementsExample.vue @@ -4,13 +4,13 @@ import type { FormSubmitEvent, Form } from '#ui/types/form' const schema = z.object({ input: z.string().min(10), - // inputMenu: z.any().refine(option => option?.value === 'option-2', { - // message: 'Select Option 2' - // }), + inputMenu: z.any().refine(option => option?.value === 'option-2', { + message: 'Select Option 2' + }), textarea: z.string().min(10), - // select: z.string().refine(value => value === 'option-2', { - // message: 'Select Option 2' - // }), + select: z.string().refine(value => value === 'option-2', { + message: 'Select Option 2' + }), // selectMenu: z.any().refine(option => option?.value === 'option-2', { // message: 'Select Option 2' // }), @@ -31,7 +31,7 @@ type Schema = z.output const state = reactive>({}) const form = ref>() -const options = [ +const items = [ { label: 'Option 1', value: 'option-1' }, { label: 'Option 2', value: 'option-2' }, { label: 'Option 3', value: 'option-3' } @@ -58,12 +58,20 @@ function onSubmit(event: FormSubmitEvent) { + + + + + + + + - + diff --git a/playground/pages/input-menu.vue b/playground/pages/input-menu.vue index 78447ff0..638c0fbb 100644 --- a/playground/pages/input-menu.vue +++ b/playground/pages/input-menu.vue @@ -34,14 +34,15 @@ const { data: users, pending } = await useFetch('https://jsonplaceholder.typicod params: { q: searchTermDebounced }, transform: (data: User[]) => { return data?.map(user => ({ id: user.id, label: user.name, avatar: { src: `https://i.pravatar.cc/120?img=${user.id}` } })) || [] - } + }, + lazy: true })