📅  最后修改于: 2022-03-11 14:48:35.336000             🧑  作者: Mango
_keyUp(event: any) {
const pattern = /[0-9\+\-\ ]/;
let inputChar = String.fromCharCode(event.key);
if (!pattern.test(inputChar)) {
// invalid character, prevent input
event.preventDefault();
}
}