Newer
Older
KaiFengPC / src / views / spongePerformance / management / validate.js
@zhangdeliang zhangdeliang on 23 May 259 bytes 初始化项目
  1. export const numberValidate = (rule, value, callback) => {
  2. if (value === '') {
  3. callback(new Error('分值不能为空'))
  4. } else {
  5. const reg = /^[1-9]+\d*$/
  6. if(reg.test(value)) callback()
  7. else callback(new Error('请输入正整数'))
  8. }
  9. }