mounted() {
cardvalue = "";
let that = this
document.onkeydown = function(e) {
let _key = String.fromCharCode(window.event.keyCode);
if (_key >= 0 || _key <= 9) {
cardvalue = cardvalue + _key;
}
// 读完之后就会有一次回车操作 window.event.keyCode
if (window.event.keyCode == 13 && cardvalue.trim().length > 1) {
that.cardvalue = parseInt(cardvalue);
cardvalue = "";
} else if (window.event.keyCode == 13) {
cardvalue = "";
}
};
}