2019-02-18 09:18:32 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<slot :isVisible="isVisible" />
|
|
|
|
<span
|
|
|
|
ref="revealButton"
|
|
|
|
type="button"
|
|
|
|
:class="[
|
|
|
|
'reveal-password tooltipped tooltipped-n tooltipped-no-delay',
|
|
|
|
{ 'reveal-password-visible': isVisible },
|
|
|
|
]"
|
|
|
|
:aria-label="isVisible ? 'Hide password' : 'Show password'"
|
2019-03-01 14:18:16 +00:00
|
|
|
@click="onClick"
|
|
|
|
>
|
2019-02-18 09:18:32 +00:00
|
|
|
<span
|
2019-03-01 14:18:16 +00:00
|
|
|
:aria-label="isVisible ? 'Hide password' : 'Show password'"
|
|
|
|
/>
|
2019-02-18 09:18:32 +00:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: "RevealPassword",
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
isVisible: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onClick() {
|
|
|
|
this.isVisible = !this.isVisible;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|