判断是否为数字 - davy-gan/web GitHub Wiki

const checkIsNum = value => {
  const reg = /^-?(0|[1-9][0-9]*)(\.[0-9]*)?$/;
  return (!Number.isNaN(value) && reg.test(value)) || value === '' || value === '-';
};