Password component default value display issue fixed
parent
36f3e3f20e
commit
537552e1f4
|
@ -100,6 +100,10 @@ export default {
|
||||||
this.infoText = this.promptText;
|
this.infoText = this.promptText;
|
||||||
this.mediumCheckRegExp = new RegExp(this.mediumRegex);
|
this.mediumCheckRegExp = new RegExp(this.mediumRegex);
|
||||||
this.strongCheckRegExp = new RegExp(this.strongRegex);
|
this.strongCheckRegExp = new RegExp(this.strongRegex);
|
||||||
|
if(this.value){
|
||||||
|
this.d_value = this.value;
|
||||||
|
this.setPasswordMeter()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.restoreAppend();
|
this.restoreAppend();
|
||||||
|
@ -180,9 +184,34 @@ export default {
|
||||||
onKeyUp(event) {
|
onKeyUp(event) {
|
||||||
if (this.feedback) {
|
if (this.feedback) {
|
||||||
let value = event.target.value;
|
let value = event.target.value;
|
||||||
let label = null;
|
|
||||||
let meter = null;
|
const {meter,label} = this.checkPasswordStrength(value);
|
||||||
switch (this.testStrength(value)) {
|
|
||||||
|
this.meter = meter;
|
||||||
|
this.infoText = label;
|
||||||
|
if (!this.overlayVisible) {
|
||||||
|
this.overlayVisible = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$emit('keyup', event);
|
||||||
|
},
|
||||||
|
setPasswordMeter() {
|
||||||
|
if(!this.feedback) return;
|
||||||
|
|
||||||
|
const {meter,label} = this.checkPasswordStrength(this.d_value);
|
||||||
|
|
||||||
|
this.meter = meter;
|
||||||
|
this.infoText = label;
|
||||||
|
|
||||||
|
if (!this.overlayVisible) {
|
||||||
|
this.overlayVisible = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
checkPasswordStrength(value) {
|
||||||
|
let label = null;
|
||||||
|
let meter = null;
|
||||||
|
switch (this.testStrength(value)) {
|
||||||
case 1:
|
case 1:
|
||||||
label = this.weakText;
|
label = this.weakText;
|
||||||
meter = {
|
meter = {
|
||||||
|
@ -208,15 +237,9 @@ export default {
|
||||||
label = this.promptText;
|
label = this.promptText;
|
||||||
meter = null;
|
meter = null;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
this.meter = meter;
|
|
||||||
this.infoText = label;
|
|
||||||
if (!this.overlayVisible) {
|
|
||||||
this.overlayVisible = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$emit('keyup', event);
|
return { label, meter };
|
||||||
},
|
},
|
||||||
bindScrollListener() {
|
bindScrollListener() {
|
||||||
if (!this.scrollHandler) {
|
if (!this.scrollHandler) {
|
||||||
|
|
Loading…
Reference in New Issue