ソースを参照

增加手机校验规则

zhangliang2 2 年 前
コミット
106471b4a4
1 ファイル変更11 行追加0 行削除
  1. 11 0
      src/lib/util.js

+ 11 - 0
src/lib/util.js

@@ -212,6 +212,17 @@ function TimeFormatter(time){
 
  Vue.prototype.$validatePhone = ValidatePhone
 
+ function ValidateMobilePhone(val){
+    let mobReg = /0?1[0-9]\d{9}$/;
+    if (mobReg.test(val)) {
+        return true
+    } else {
+        return false
+    }
+ }
+
+ Vue.prototype.$ValidateMobilePhone = ValidateMobilePhone
+
  function ValidateInteger(val,max){
     let reg = /(^[0-9]\d*$)/
     if(reg.test(val)){