首页 > 其他分享 >vue表单手机号校验

vue表单手机号校验

时间:2022-09-27 14:35:09浏览次数:62  
标签:11 vue 手机号 校验 value 表单 blur message

<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

相关文章