刘浩男 1 rok pred
rodič
commit
54706ee42d
1 zmenil súbory, kde vykonal 9 pridanie a 11 odobranie
  1. 9 11
      pages/quotations/quotationsForm.vue

+ 9 - 11
pages/quotations/quotationsForm.vue

@@ -66,18 +66,16 @@ export default {
           }]
         },
         phone: {
-          rules: [{
-            required: true,
-            errorMessage: '年龄不能为空'
-          }, {
-            validateFunction: function(rule, value, data, callback) {
-              const reg = /^1[3-9]\.\d{9}$/;
-              if (!reg.test(value)) {
-                callback('请输入正确的手机号码');
-              }
-              return true;
+          rules: [
+            {
+              required: true,
+              errorMessage: '手机号码不能为空'
+            },
+            {
+              pattern:'^1[3456789]\\d{9}$',
+              errorMessage: '手机号不合法'
             }
-          }]
+          ]
         },
         address: {
           rules: [{