Fix #5412 - Twice render if attribute id not defined

This commit is contained in:
i7slegend 2024-03-27 05:37:32 +03:00
parent 7c2e3eac7e
commit 3a134dd561
30 changed files with 162 additions and 131 deletions

View file

@ -77,9 +77,12 @@ export default {
};
},
watch: {
'$attrs.id': function (newValue) {
this.id = newValue || UniqueComponentId();
}
'$attrs.id': {
immediate: true,
handler: function (newValue) {
this.id = newValue || UniqueComponentId();
},
},
},
mediumCheckRegExp: null,
strongCheckRegExp: null,
@ -87,7 +90,6 @@ export default {
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);