el-form-item必填项校验
时间: 2023-11-05 10:19:40 浏览: 141
element form 校验数组每一项实例代码
在el-form-item中,使用了prop属性来指定校验规则的字段名,同时在rules属性中定义了校验规则。prop属性的值应该与rules规则指定的字段值保持一致。例如,在第一步中的代码中,prop="groupList[${index}].man"指定了校验规则的字段名为groupList[index].man,而在第三步的代码中,rules规则中的name字段与prop属性的值相对应,表示要对name字段进行必填项校验。所以,el-form-item的必填项校验是通过prop属性和rules规则来实现的。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [el-form检验数组对象必填及规则](https://blog.csdn.net/enhenglhm/article/details/129968403)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [element 结合vue 在表单验证时有值却提示错误的解决办法](https://download.csdn.net/download/weixin_38733597/14902378)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文