Skip to content

Commit

Permalink
feat(mellow-vue): display validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DominusKelvin committed Feb 22, 2024
1 parent 1a95290 commit bcad323
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions templates/mellow-vue/assets/js/pages/signup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ const disableSignupButton = computed(() => {
Welcome! Please enter your details to sign up
</p>
</section>
<p
class="b my-4 rounded-sm border-red-400 bg-red-100 p-4 text-red-500"
v-if="form.errors.signup"
>
{{ form.errors?.signup }}
</p>
<form
@submit.prevent="form.post('/signup')"
class="mb-4 flex flex-col space-y-6"
Expand Down Expand Up @@ -101,6 +107,9 @@ const disableSignupButton = computed(() => {
class="block w-full rounded-lg border border-gray/50 bg-white py-3 pl-10 pr-3 shadow-sm placeholder:text-lg placeholder:text-gray focus:outline-none focus:ring-1 focus:ring-gray-100"
v-model="form.fullName"
/>
<p class="absolute text-red-500" v-if="form.errors.fullName">
{{ form.errors.fullName }}
</p>
</label>
<label for="email" class="relative block"
><span class="block text-lg">Email</span>
Expand All @@ -124,6 +133,9 @@ const disableSignupButton = computed(() => {
class="block w-full rounded-lg border border-gray/50 bg-white py-3 pl-10 pr-3 shadow-sm placeholder:text-lg placeholder:text-gray focus:outline-none focus:ring-1 focus:ring-gray-100"
v-model="form.email"
/>
<p class="absolute text-red-500" v-if="form.errors.email">
{{ form.errors.email }}
</p>
</label>
<label for="password" class="relative block"
><span class="block text-lg">Password</span>
Expand Down Expand Up @@ -214,6 +226,9 @@ const disableSignupButton = computed(() => {
</svg>
</button>
</span>
<p class="absolute text-red-500" v-if="form.errors.password">
{{ form.errors.password }}
</p>
</label>
<ul class="flex justify-between text-sm">
<li
Expand Down

0 comments on commit bcad323

Please sign in to comment.