optimize views/login/index.vue CheckCapslock method
This commit is contained in:
parent
46cc375d0d
commit
3231a995aa
|
@ -139,16 +139,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkCapslock({ shiftKey, key } = {}) {
|
checkCapslock({ shiftKey, key } = {}) {
|
||||||
if (key && key.length === 1) {
|
this.capsTooltip = (key && key.length === 1 && (shiftKey && (key >= 'A' && key <= 'Z') || !shiftKey && (key >= 'A' && key <= 'Z')))
|
||||||
if (shiftKey && (key >= 'a' && key <= 'z') || !shiftKey && (key >= 'A' && key <= 'Z')) {
|
|
||||||
this.capsTooltip = true
|
|
||||||
} else {
|
|
||||||
this.capsTooltip = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (key === 'CapsLock' && this.capsTooltip === true) {
|
|
||||||
this.capsTooltip = false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
showPwd() {
|
showPwd() {
|
||||||
if (this.passwordType === 'password') {
|
if (this.passwordType === 'password') {
|
||||||
|
|
Loading…
Reference in New Issue