2023-02-05 21:56:47 +00:00
|
|
|
<template>
|
2023-03-23 05:52:25 +00:00
|
|
|
<div class="relative">
|
2023-07-31 14:08:35 +00:00
|
|
|
<FormTextField v-model="value" placeholder="Password" :label="label" :type="inputType"> </FormTextField>
|
2023-02-05 21:56:47 +00:00
|
|
|
<button
|
|
|
|
type="button"
|
2023-03-23 05:52:25 +00:00
|
|
|
class="inline-flex p-1 ml-1 justify-center mt-auto mb-3 tooltip absolute top-11 right-3"
|
2023-02-05 21:56:47 +00:00
|
|
|
data-tip="Toggle Password Show"
|
|
|
|
@click="toggle()"
|
|
|
|
>
|
|
|
|
<Icon name="mdi-eye" class="h-5 w-5" />
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
type Props = {
|
|
|
|
modelValue: string;
|
2023-08-02 21:00:57 +00:00
|
|
|
placeholder?: string;
|
2023-02-05 21:56:47 +00:00
|
|
|
label: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
|
|
placeholder: "Password",
|
|
|
|
label: "Password",
|
|
|
|
});
|
|
|
|
|
|
|
|
const [hide, toggle] = useToggle(true);
|
|
|
|
|
|
|
|
const inputType = computed(() => {
|
|
|
|
return hide.value ? "password" : "text";
|
|
|
|
});
|
|
|
|
|
|
|
|
const value = useVModel(props, "modelValue");
|
|
|
|
</script>
|