This commit is contained in:
MaYuanhai
2020-12-05 03:55:52 -08:00
committed by GitHub

View File

@@ -138,9 +138,15 @@ export default {
// window.removeEventListener('storage', this.afterQRScan) // window.removeEventListener('storage', this.afterQRScan)
}, },
methods: { methods: {
checkCapslock(e) { checkCapslock({ shiftKey, key }) {
const { key } = e if (key && key.length === 1) {
this.capsTooltip = key && key.length === 1 && (key >= 'A' && key <= 'Z') if (shiftKey && (key >= 'a' && key <= 'z') || !shiftKey && (key >= 'A' && key <= 'Z')) {
this.capsTooltip = true
} else {
this.capsTooltip = false
}
}
key === 'CapsLock' && this.capsTooltip === true && (this.capsTooltip = false)
}, },
showPwd() { showPwd() {
if (this.passwordType === 'password') { if (this.passwordType === 'password') {