-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show/hide password on login page (#310)
* login page enhancement * remove border * add title tag * some tweaks * show/hide password on change password page * show/hide for all three form fields * minor changes to change password page * password component made * remove unnecessary code * fix props warning * final tweaks --------- Co-authored-by: Daniel Townsend <dan@dantownsend.co.uk>
- Loading branch information
1 parent
ba9da95
commit c69646b
Showing
4 changed files
with
80 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<div class="password_wrapper"> | ||
<input | ||
name="password" | ||
v-bind:value="value" | ||
v-bind:type="showPassword ? 'text' : 'password'" | ||
v-on:input="$emit('input', $event.target.value)" | ||
/> | ||
<span | ||
class="viewer" | ||
v-if="value" | ||
v-on:click="showPassword = !showPassword" | ||
> | ||
<font-awesome-icon | ||
v-if="!showPassword" | ||
icon="eye" | ||
title="Show password" | ||
/> | ||
<font-awesome-icon v-else icon="eye-slash" title="Hide password" /> | ||
</span> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
export default { | ||
props: { | ||
value: String | ||
}, | ||
data() { | ||
return { | ||
showPassword: false | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="less"> | ||
div.password_wrapper { | ||
position: relative; | ||
span.viewer { | ||
color: #878787; | ||
position: absolute; | ||
top: 0.5rem; | ||
right: 0.5rem; | ||
z-index: 1; | ||
cursor: pointer; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters