export default function (el) {
  var input = el
  input.onkeyup = function (e) {
    if (e.target.value.length == 1) {
      e.target.value = e.target.value.replace(/[^0-9]/g, '')
      e.target.dispatchEvent(new Event('input'))
    } else {
      e.target.value = e.target.value.replace(/[^\d]/g, '')
      e.target.dispatchEvent(new Event('input'))
    }
  }
}
