python基础篇(二十五)——总结

常见关联图库之欺诈指数排位战

  返回  

vue || element-ui || el-input == 验证手机号

2021/8/21 16:46:13 浏览:

el-input == 验证手机号

html

<el-form ref="form" :model="formData" label-width="120px" label-position="right" :rules="rules">
          <el-form-item label="姓名" prop="buUserName">
            <el-input v-model="formData.buUserName" placeholder="请填写姓名"></el-input>
          </el-form-item>
          <el-form-item label="电话号" prop="buPhone">
            <el-input v-model="formData.buPhone" placeholder="请填写电话号"></el-input>
          </el-form-item>
          <el-form-item label="性别" prop="buSex">
            <el-radio-group v-model="formData.buSex">
              <el-radio label="0" border></el-radio>
              <el-radio label="1" border></el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>

javascript

formData: {},
      rules: {
        buUserName:[{required:true,message: '请填写姓名', trigger: 'change'}],
        buPhone:[
          { required: true, message: "请输入电话号码", trigger: "blur" },
          { min: 11, max: 11, message: "请输入11位电话号码", trigger: "blur" },
          {
            pattern: /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/,
            message: "请输入正确的电话号码",
          }
        ],
        buSex:[{required:true,message: '请填写性别', trigger: 'change'}]
      }

联系我们

如果您对我们的服务有兴趣,请及时和我们联系!

服务热线:18288888888
座机:18288888888
传真:
邮箱:888888@qq.com
地址:郑州市文化路红专路93号