Skip to content

Commit

Permalink
fix(example): fix dialog-form onsubmit
Browse files Browse the repository at this point in the history
  • Loading branch information
rhanlin committed Nov 9, 2024
1 parent be888c8 commit 065bde0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/www/src/lib/registry/default/example/DialogForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function onSubmit(values: any) {
</script>

<template>
<Form v-slot="{ submitForm }" as="" :validation-schema="formSchema" @submit="onSubmit">
<Form v-slot="{ handleSubmit }" as="" :validation-schema="formSchema">
<Dialog>
<DialogTrigger as-child>
<Button variant="outline">
Expand All @@ -53,7 +53,7 @@ function onSubmit(values: any) {
</DialogDescription>
</DialogHeader>

<form @submit="submitForm">
<form id="dialogForm" @submit="handleSubmit($event, onSubmit)">
<FormField v-slot="{ componentField }" name="username">
<FormItem>
<FormLabel>Username</FormLabel>
Expand Down
4 changes: 2 additions & 2 deletions apps/www/src/lib/registry/new-york/example/DialogForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function onSubmit(values: any) {
</script>

<template>
<Form v-slot="{ submitForm }" as="" keep-values :validation-schema="formSchema" @submit="onSubmit">
<Form v-slot="{ handleSubmit }" as="" keep-values :validation-schema="formSchema">
<Dialog>
<DialogTrigger as-child>
<Button variant="outline">
Expand All @@ -53,7 +53,7 @@ function onSubmit(values: any) {
</DialogDescription>
</DialogHeader>

<form @submit="submitForm">
<form id="dialogForm" @submit="handleSubmit($event, onSubmit)">
<FormField v-slot="{ componentField }" name="username">
<FormItem>
<FormLabel>Username</FormLabel>
Expand Down

0 comments on commit 065bde0

Please sign in to comment.