-
Notifications
You must be signed in to change notification settings - Fork 0
/
FormLogin.vue
60 lines (57 loc) · 1.5 KB
/
FormLogin.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<script setup lang="ts">
import { ref } from "vue"
defineProps({
error: [Object, String],
sending: Boolean
})
const emit = defineEmits(['submit'])
const email = ref(null)
const password = ref(null)
const submit = async () => {
emit('submit', {
email: email.value,
password: password.value
})
}
</script>
<template>
<form @submit.prevent="submit">
<AppInput
type="email"
label="Correo Electrónico"
name="email"
v-model="email"
autocomplete="email"
placeholder="email@domain.ext"
class="mb-2"
data-testid="email-input"
/>
<AppInput
type="password"
label="Contraseña"
name="password"
placeholder="password"
v-model="password"
class="mb-4"
data-testid="password-input"
/>
<div class="flex items-center justify-between mt-4">
<label class="flex items-center">
<input
type="checkbox"
class="rounded border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50i mb-4"
name="remember">
<span class="ml-2 mb-3 text-sm text-gray-600">
Recuérdame
</span>
</label>
<AppBtn
type="submit"
:text="sending ? 'Iniciando sesión...' : 'Iniciar sesión'"
:isDisabled='sending'
data-testid="submit-btn"
/>
</div>
<AppFlashMessage :error='error' />
</form>
</template>