optimize views/login/index.vue CheckCapslock method

This commit is contained in:
shangtou 2019-08-09 17:07:30 +08:00
parent 46cc375d0d
commit 3231a995aa
1 changed files with 1 additions and 10 deletions

View File

@ -139,16 +139,7 @@ export default {
},
methods: {
checkCapslock({ shiftKey, key } = {}) {
if (key && key.length === 1) {
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
}
this.capsTooltip = (key && key.length === 1 && (shiftKey && (key >= 'A' && key <= 'Z') || !shiftKey && (key >= 'A' && key <= 'Z')))
},
showPwd() {
if (this.passwordType === 'password') {