Skip to content

Commit 3e096da

Browse files
author
JB AUBREE
committed
docs: update playground
1 parent 92eb24f commit 3e096da

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

playground/src/App.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,16 @@ async function onSubmit() {
4141
<template>
4242
<UContainer class="py-5">
4343
<UText as="h1" label="Form example" class="mb-5" :ui="{ font: 'font-bold', size: 'text-2xl' }" />
44-
<UCard v-if="hasError" class="mb-5" :ui="{ background: 'bg-red-200 dark:bg-red-600', body: { base: 'flex flex-col items-start gap-2' } }">
44+
<form class="flex flex-col gap-3 mb-5">
45+
<UFormGroup label="Email" :error="getErrorMessage('email')" is-required>
46+
<UInput v-model="form.email" name="email" type="email" placeholder="[email protected]" autofocus size="md" />
47+
</UFormGroup>
48+
<UFormGroup label="Password" :error="getErrorMessage('password')" is-required>
49+
<UInput v-model="form.password" name="password" type="password" placeholder="**********" size="md" />
50+
</UFormGroup>
51+
<UButton label="Submit" color="pilot" is-block :is-loading="isLoading" @click="onSubmit" />
52+
</form>
53+
<UCard v-if="hasError" :ui="{ background: 'bg-red-200 dark:bg-red-600', body: { base: 'flex flex-col items-start gap-2' } }">
4554
<UText :label="`Form has ${errorCount} ${errorCount > 1 ? 'errors' : 'error'}:`" :ui="{ font: 'font-bold', size: 'text-lg' }" class="mb-1" />
4655
<div
4756
v-for="
@@ -58,15 +67,6 @@ async function onSubmit() {
5867
/>
5968
</div>
6069
</UCard>
61-
<form class="flex flex-col gap-3">
62-
<UFormGroup label="Email" :error="getErrorMessage('email')" is-required>
63-
<UInput v-model="form.email" name="email" type="email" placeholder="[email protected]" autofocus size="md" />
64-
</UFormGroup>
65-
<UFormGroup label="Password" :error="getErrorMessage('password')" is-required>
66-
<UInput v-model="form.password" name="password" type="password" placeholder="**********" size="md" />
67-
</UFormGroup>
68-
<UButton label="Submit" is-block :is-loading="isLoading" @click="onSubmit" />
69-
</form>
7070
</UContainer>
7171
<Teleport to="body">
7272
<UNotifications />

0 commit comments

Comments
 (0)