diff --git a/src/components/password/Password.d.ts b/src/components/password/Password.d.ts index c36a3102da..146150eba3 100755 --- a/src/components/password/Password.d.ts +++ b/src/components/password/Password.d.ts @@ -13,6 +13,8 @@ declare class Password extends Vue { toggleMask?: boolean; inputStyle?: any; inputClass?: string; + hideIcon?: string; + showIcon?: string; $emit(eventName: 'input', value: any): this; $emit(eventName: 'focus', event: Event): this; $emit(eventName: 'blur', event: Event): this; diff --git a/src/components/password/Password.vue b/src/components/password/Password.vue index 436efd7b0f..ae6d0ba879 100755 --- a/src/components/password/Password.vue +++ b/src/components/password/Password.vue @@ -61,6 +61,14 @@ export default { type: Boolean, default: false }, + hideIcon: { + type: String, + default: 'pi pi-eye-slash' + }, + showIcon: { + type: String, + default: 'pi pi-eye' + }, inputClass: null, inputStyle: null, styles: null, @@ -256,7 +264,7 @@ export default { }]; }, toggleIconClass() { - return this.unmasked ? 'pi pi-eye-slash' : 'pi pi-eye'; + return this.unmasked ? this.hideIcon : this.showIcon; }, strengthClass() { return `p-password-strength ${this.meter ? this.meter.strength : ''}`; diff --git a/src/views/password/PasswordDoc.vue b/src/views/password/PasswordDoc.vue index 977cfc5261..f117d861b9 100755 --- a/src/views/password/PasswordDoc.vue +++ b/src/views/password/PasswordDoc.vue @@ -142,6 +142,18 @@ import Password from 'primevue/password'; string null Style class of the input field. + + + hideIcon + string + pi pi-eye-slash + Icon to hide displaying the password as plain text. + + + showIcon + string + pi pi-eye + Icon to show displaying the password as plain text.