forked from verdnatura/hedera-web
feat: add password visibility
This commit is contained in:
parent
4256f45373
commit
6bad41db20
|
@ -16,6 +16,9 @@ const props = defineProps({
|
|||
});
|
||||
|
||||
const emit = defineEmits(['onPasswordChanged']);
|
||||
const showOldPwd = ref(false);
|
||||
const showNewPwd = ref(false);
|
||||
const showCopyPwd = ref(false);
|
||||
|
||||
const { t } = useI18n();
|
||||
const api = inject('api');
|
||||
|
@ -107,20 +110,40 @@ onMounted(async () => {
|
|||
v-if="!verificationToken"
|
||||
ref="oldPasswordRef"
|
||||
v-model="formData.oldPassword"
|
||||
:type="!showOldPwd ? 'password' : 'text'"
|
||||
:label="t('oldPassword')"
|
||||
type="password"
|
||||
>
|
||||
<template #append>
|
||||
<QIcon
|
||||
:name="showOldPwd ? 'visibility_off' : 'visibility'"
|
||||
class="cursor-pointer"
|
||||
@click="showOldPwd = !showOldPwd"
|
||||
/>
|
||||
</template>
|
||||
</VnInput>
|
||||
<VnInput
|
||||
ref="newPasswordRef"
|
||||
v-model="formData.newPassword"
|
||||
:type="!showNewPwd ? 'password' : 'text'"
|
||||
:label="t('newPassword')"
|
||||
type="password"
|
||||
><template #append>
|
||||
<QIcon
|
||||
:name="showNewPwd ? 'visibility_off' : 'visibility'"
|
||||
class="cursor-pointer"
|
||||
@click="showNewPwd = !showNewPwd"
|
||||
/>
|
||||
</template></VnInput>
|
||||
<VnInput
|
||||
v-model="repeatPassword"
|
||||
:type="!showCopyPwd ? 'password' : 'text'"
|
||||
:label="t('repeatPassword')"
|
||||
type="password"
|
||||
><template #append>
|
||||
<QIcon
|
||||
:name="showCopyPwd ? 'visibility_off' : 'visibility'"
|
||||
class="cursor-pointer"
|
||||
@click="showCopyPwd = !showCopyPwd"
|
||||
/>
|
||||
</template></VnInput>
|
||||
</template>
|
||||
<template #actions>
|
||||
<QBtn
|
||||
|
|
Loading…
Reference in New Issue