<el-form-item label="联系方式" prop="picPhone"> <el-input clearable v-model="form.picPhone" placeholder="请输入联系方式" oninput="value=value.replace(/[^\d]/g,'');if(value.length > 11)value = value.slice(0, 11)" /> </el-form-item>
data(){ return{ rules:{ picPhone: [ { required: true, message: '请输入', trigger: 'blur' }, { min: 11, message: "手机号格式不正确", trigger: "blur" } ], } } }
标签:11,vue,手机号,校验,value,表单,blur,message From: https://www.cnblogs.com/alannero/p/16734442.html