@fouro/elx
Advanced tools
Sorry, the diff of this file is not supported yet
+1
-1
| { | ||
| "name": "@fouro/elx", | ||
| "version": "1.0.53", | ||
| "version": "1.0.54", | ||
| "description": "element-ui components", | ||
@@ -5,0 +5,0 @@ "main": "/src", |
@@ -59,3 +59,4 @@ <template> | ||
| inputValue: '', | ||
| realValue: '' | ||
| realValue: '', | ||
| encoded: false, | ||
| } | ||
@@ -66,7 +67,19 @@ }, | ||
| if (newValue !== undefined && newValue !== null) { | ||
| if (newValue.length > oldValue.length) { | ||
| this.realValue += newValue.slice(oldValue.length) | ||
| this.inputValue = newValue.replace(/[\S\s]/g, '*') | ||
| } else if (newValue.length < oldValue.length) { | ||
| this.realValue = this.realValue.slice(0, newValue.length) | ||
| if (!this.encoded) { | ||
| if ((newValue.length == oldValue.length + 1) && newValue.indexOf(oldValue) == 0) { | ||
| // user inputs | ||
| this.realValue += newValue.slice(oldValue.length) | ||
| this.inputValue = this.realValue.replace(/[\S\s]/g, '*') | ||
| this.encoded = true | ||
| } else if ((newValue.length == oldValue.length - 1) && oldValue.indexOf(newValue) == 0) { | ||
| // user deletes | ||
| this.realValue = this.realValue.slice(0, newValue.length) | ||
| } else { | ||
| // user pastes or something | ||
| this.realValue = newValue | ||
| this.inputValue = this.realValue.replace(/[\S\s]/g, '*') | ||
| this.encoded = true | ||
| } | ||
| } else { | ||
| this.encoded = false | ||
| } | ||
@@ -81,4 +94,4 @@ } else { | ||
| this.inputValue = this.value | ||
| }, | ||
| } | ||
| } | ||
| </script> |
908644
0.74%84
1.2%