mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 05:50:22 +00:00
dd05ee3a65
Co-authored-by: Eric Nemchik <eric@nemchik.com> Co-authored-by: Pavel Djundik <xPaw@users.noreply.github.com>
37 lines
715 B
Vue
37 lines
715 B
Vue
<template>
|
|
<div>
|
|
<slot :is-visible="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'"
|
|
@click="onClick"
|
|
>
|
|
<span :aria-label="isVisible ? 'Hide password' : 'Show password'" />
|
|
</span>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import {defineComponent, ref} from "vue";
|
|
|
|
export default defineComponent({
|
|
name: "RevealPassword",
|
|
setup() {
|
|
const isVisible = ref(false);
|
|
|
|
const onClick = () => {
|
|
isVisible.value = !isVisible.value;
|
|
};
|
|
|
|
return {
|
|
isVisible,
|
|
onClick,
|
|
};
|
|
},
|
|
});
|
|
</script>
|