feat: validate email

This commit is contained in:
Methapon Metanipat 2024-09-05 15:50:51 +07:00
parent d6e8d754ab
commit 9466019303
3 changed files with 18 additions and 0 deletions

View file

@ -31,6 +31,12 @@ const telephone = defineModel<string>('telephone');
hide-bottom-space
class="col-md-6 col-12"
:label="$t('form.email')"
:rules="[
(v: string) => !!v || $t('form.error.required'),
(v: string) =>
/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/g.test(v) ||
$t('form.error.invalid'),
]"
v-model="mail"
/>
<q-input