el-form的必填项
时间: 2023-10-09 20:07:04 浏览: 100
vue elementui el-form rules动态验证的实例代码详解
根据提供的引用内容可以得出以下结论:
引用中的代码展示了一个el-form的表单结构,其中的必填项通过rules属性进行验证。具体来说,fIncomeWay和fOppositeBank是必填项,分别对应的规则为:
fIncomeWay的规则为:[{ required: true, message: "请选择来款方式", trigger: ["blur", "change"] }]
fOppositeBank的规则为:[{ required: true, message: "请输入来款银行", trigger: "blur" }]
引用中的代码展示了另一个el-form的表单结构,其中的mobilePhone和email是必填项,分别对应的规则为:
mobilePhone的规则为:[{ required: true, message: '请输入手机号码', trigger: 'blur' }, { validator: checkMobile, max: 11, message: '请输入正确的格式', trigger: 'blur' }]
email的规则为:[{ required: true, message: '请输入电子邮箱', trigger: 'blur' }, { validator: checkEmail, max: 11, message: '请输入正确的格式', trigger: 'blur' }]
根据引用中的介绍,el-form的必填项可以通过设置相应的rules属性中的required为true来实现。以上就是el-form的必填项的相关信息。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Element el-form根据选择条件动态控制表单必填项](https://blog.csdn.net/zhouqionger/article/details/106576030)[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_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [ElementUI:关于 el-form 必填项的校验规则](https://blog.csdn.net/weixin_43900414/article/details/107670469)[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_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [vue elementui el-form rules动态验证的实例代码详解](https://download.csdn.net/download/weixin_38670297/12941851)[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_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文