vue+element-ui el-input验证手机号 / 身份证
element
A Vue.js 2.0 UI Toolkit for Web
项目地址:https://gitcode.com/gh_mirrors/eleme/element
免费下载资源
·
el-input验证手机号
html
<el-form ref="Form" :rules="rules" :model="edit" label-width="100px">
<el-form-item label="联系方式" prop="phone">
<el-input v-model="edit.phone"></el-input>
</el-form-item>
</rl-form>
js
edit: {
phone: ""
},
rules: {
phone: [
{ 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}$/,
//pattern: /^1[3456789]\d{9}$/,
message: "请输入正确的手机号码",
},
],
id_number: [
{
pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
message: "请输入正确的身份证号码",
},
],
},
展示页面
GitHub 加速计划 / eleme / element
54.06 K
14.63 K
下载
A Vue.js 2.0 UI Toolkit for Web
最近提交(Master分支:3 个月前 )
c345bb45
7 个月前
a07f3a59
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update transition.md
* Update table.md
* Update table.md
* Update transition.md
* Update popover.md 7 个月前
更多推荐
已为社区贡献11条内容
所有评论(0)