注意不要用event.keyCode, https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent
js代码
resetBankAccountNumber(id) {
this.setBankAccountValidity('ownBankAccount', true, id);
}
isInputtedValidKey(key) {
if (key !== 'Tab' && key !== 'CapsLock') {
return true;
}
return false;
}
filterValidKeyAndResetBankAccount(id, event) {
if (event && this.isInputtedValidKey(event.key)) {
this.resetBankAccountNumber(id);
}
}
setBankAccountValidity(type, value, id) {
if (this.form['bankAccountNumberField' + id]) {
this.form['bankAccountNumberField' + id]['bankAccountNumber' + id].$setValidity(type, value);
}
}
html代码
<inp