表单验证规则---antd

//表单验证规则
validateRules: {
// 必填验证
required: [{ required: true, message: '不可为空!' }],
//邮箱验证
companyEmail: [{ required: true, message: '不可为空!' }],
//公司电话验证
companyTelephone: [
{ required: true, message: '不可为空!' },
{
pattern: /((0\d{2,3}-?\d{7,8})|(1[34578]\d{9}))/, message: '请输入正确格式的企业号码', }, ], //联系人电话验证 telephone: [ { required: true, message: '不可为空!' }, { pattern: /^1[34578]\d{9}/, message: '请输入正确格式的手机号码' },
],
},

你可能感兴趣的:(表单验证规则---antd)