赞
踩
- <el-form class="apply-form first-form" :model="formData" :rules="rule" ref="form">
- <el-form-item label="姓名" prop="visitorName">
- <el-input v-model="formData.visitorName" placeholder="请输入姓名" clearable></el-input>
- </el-form-item>
- <el-form-item label="身份证号" prop="cardCode">
- <el-input v-model="formData.cardCode" :maxlength="18" placeholder="请输入身份证号" clearable></el-input>
- </el-form-item>
- </el-form>
这种方式需要在data()中写入rule{},对于需要校验字段prop中的如visitorName写上验证规则,如下:
- data() {
- return {
- formData: {
- visitorName: '',
- cardType: 1,
- cardCode: ''
- },
- rule: {
- vi
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。