表单验证规则

  UserInformationRules: {
        username: [{
          required: true,
          message: '姓名不能为空'
        }, {
          pattern: /^[\u4e00-\u9fa5]{2,6}$/,
          message: '姓名格式不正确'
        }],
        mobile: [{
          required: true,
          message: '手机号码不能为空'
        }, {
          pattern: /^1[3|5|7|8|9]\d{9}$/,
          message: '手机号码格式不正确'
        }],
        address: [{
          required: true,
          message: '地址不能为空'
        }, {
          pattern: /^.+小区.+单元.+(室|户).*$/,
          message: '地址格式不正确'
        }],
        code: [{
          required: true,
          message: '验证码不能为空'
        }, {
          pattern: /^\d{6}$/,
          message: '验证码错误'
        }]
      }

 

posted @ 2020-10-16 09:38  缔造cool  阅读(128)  评论(0编辑  收藏  举报