Skip to content

Instantly share code, notes, and snippets.

@mohammadYousefiDev
Created August 19, 2020 07:29
Show Gist options
  • Save mohammadYousefiDev/23726d015ae041cd210682d22f2809b1 to your computer and use it in GitHub Desktop.
Save mohammadYousefiDev/23726d015ae041cd210682d22f2809b1 to your computer and use it in GitHub Desktop.
Toggle to hide or show password in Vuetify
<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