front > login : add toggle visibility button

This commit is contained in:
isUnknown 2025-05-05 17:46:49 +02:00
parent ba35e50c6f
commit 3f047abd38

View file

@ -21,13 +21,20 @@
<div class="field | w-full">
<label for="password">Mot de passe</label>
<input
type="password"
:type="isPasswordVisible ? 'text' : 'password'"
v-model="password"
id="password"
autocomplete="current-password"
class="w-full rounded-md border border-grey-200 px-16 py-12"
required
/>
<button
class="btn | w-full"
type="button"
@click="isPasswordVisible = !isPasswordVisible"
>
{{ isPasswordVisible ? 'masquer' : 'afficher' }}
</button>
</div>
<p class="error" v-if="errorMessage" v-html="errorMessage"></p>
<button
@ -47,6 +54,7 @@ import { ref, watch } from 'vue';
const email = ref('');
const isValidEmail = ref(false);
const password = ref('');
const isPasswordVisible = ref(false);
const errorMessage = ref(null);
const submitBtn = ref({