Refactor #4953 - For Password

pull/5206/head
mertsincan 2024-02-02 15:47:44 +00:00
parent dcf57813fe
commit 2b1b235f5e
1 changed files with 8 additions and 1 deletions

View File

@ -67,6 +67,7 @@ export default {
emits: ['update:modelValue', 'change', 'focus', 'blur', 'invalid'],
data() {
return {
id: this.$attrs.id,
overlayVisible: false,
meter: null,
infoText: null,
@ -74,12 +75,18 @@ export default {
unmasked: false
};
},
watch: {
'$attrs.id': function (newValue) {
this.id = newValue || UniqueComponentId();
}
},
mediumCheckRegExp: null,
strongCheckRegExp: null,
resizeListener: null,
scrollHandler: null,
overlay: null,
mounted() {
this.id = this.id || UniqueComponentId();
this.infoText = this.promptText;
this.mediumCheckRegExp = new RegExp(this.mediumRegex);
this.strongCheckRegExp = new RegExp(this.strongRegex);
@ -291,7 +298,7 @@ export default {
return this.promptLabel || this.$primevue.config.locale.passwordPrompt;
},
panelUniqueId() {
return UniqueComponentId() + '_panel';
return this.id + '_panel';
}
},
components: {