front > login : add toggle visibility button
This commit is contained in:
parent
ba35e50c6f
commit
3f047abd38
1 changed files with 9 additions and 1 deletions
|
|
@ -21,13 +21,20 @@
|
||||||
<div class="field | w-full">
|
<div class="field | w-full">
|
||||||
<label for="password">Mot de passe</label>
|
<label for="password">Mot de passe</label>
|
||||||
<input
|
<input
|
||||||
type="password"
|
:type="isPasswordVisible ? 'text' : 'password'"
|
||||||
v-model="password"
|
v-model="password"
|
||||||
id="password"
|
id="password"
|
||||||
autocomplete="current-password"
|
autocomplete="current-password"
|
||||||
class="w-full rounded-md border border-grey-200 px-16 py-12"
|
class="w-full rounded-md border border-grey-200 px-16 py-12"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
|
<button
|
||||||
|
class="btn | w-full"
|
||||||
|
type="button"
|
||||||
|
@click="isPasswordVisible = !isPasswordVisible"
|
||||||
|
>
|
||||||
|
{{ isPasswordVisible ? 'masquer' : 'afficher' }}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p class="error" v-if="errorMessage" v-html="errorMessage"></p>
|
<p class="error" v-if="errorMessage" v-html="errorMessage"></p>
|
||||||
<button
|
<button
|
||||||
|
|
@ -47,6 +54,7 @@ import { ref, watch } from 'vue';
|
||||||
const email = ref('');
|
const email = ref('');
|
||||||
const isValidEmail = ref(false);
|
const isValidEmail = ref(false);
|
||||||
const password = ref('');
|
const password = ref('');
|
||||||
|
const isPasswordVisible = ref(false);
|
||||||
const errorMessage = ref(null);
|
const errorMessage = ref(null);
|
||||||
|
|
||||||
const submitBtn = ref({
|
const submitBtn = ref({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue