From 8a4196607b61fe9cb48269913b16a6cb2e6cee29 Mon Sep 17 00:00:00 2001 From: sadeghbarati Date: Thu, 22 Aug 2024 10:45:11 +0330 Subject: [PATCH] chore: use initialValues instead of ref --- .../lib/registry/default/example/TagsInputFormDemo.vue | 9 +++++---- .../lib/registry/new-york/example/TagsInputFormDemo.vue | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/apps/www/src/lib/registry/default/example/TagsInputFormDemo.vue b/apps/www/src/lib/registry/default/example/TagsInputFormDemo.vue index 367a09e5..88766242 100644 --- a/apps/www/src/lib/registry/default/example/TagsInputFormDemo.vue +++ b/apps/www/src/lib/registry/default/example/TagsInputFormDemo.vue @@ -15,14 +15,15 @@ import { } from '@/lib/registry/default/ui/form' import { toast } from '@/lib/registry/default/ui/toast' -const modelValue = ref(['Apple', 'Banana']) - const formSchema = toTypedSchema(z.object({ fruits: z.array(z.string()).min(1).max(3), })) const { handleSubmit } = useForm({ validationSchema: formSchema, + initialValues: { + fruits: ['Apple', 'Banana'], + }, }) const onSubmit = handleSubmit((values) => { @@ -35,12 +36,12 @@ const onSubmit = handleSubmit((values) => {