<a-form-item
                label="手机号码"
                :label-col="{ span: 8 }"
                :wrapper-col="{ span: 16 }"
              >
                <a-input
                  v-decorator="[
                    'user_phone',
                    {rules: [{ required: true, message: '请输入手机号码', whitespace: true},{validator:phoneCheck.bind(this)}]}
                  ]" />
              </a-form-item>

phoneCheck (rule, value, callbackFn) {
      const reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
      if (!reg.test(value)) {
        callbackFn('请输入手机号码')
        return
      }
      callbackFn()
    },

 

Logo

前往低代码交流专区

更多推荐