Created
August 19, 2020 07:29
-
-
Save mohammadYousefiDev/23726d015ae041cd210682d22f2809b1 to your computer and use it in GitHub Desktop.
Toggle to hide or show password in Vuetify
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
<template> | |
<v-text-field | |
name="password" | |
:value="myPass" | |
label="Enter password" | |
:append-icon="value ? 'visibility' : 'visibility_off'" | |
@click:append="() => (value = !value)" | |
:type="value ? 'password' : 'text'" | |
></v-text-field> | |
</template> | |
<script> | |
export default { | |
data() { | |
return { | |
value: String, | |
}; | |
}, | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment