Existing Component
是
Component Name
el-form-item
Description
起因
在测试发现输入为空会触发提示,焦点离开时也会触发提示,如果rule只有一个触发或者说一条规则时,就会提示默认的message name is required
建议的改动
- 第一种方案: 当rules 只有一条rule条件时,其他的没有写明的rule就不触发
- 第二种: 是否可以trigger 可以支持多个动作,如下
举例一个简单的rule
name: [
{ required: true, message: '请输入名字', trigger: 'blur' },
{ required: true, message: '请输入名字', trigger: 'change' }
]
是否可以支持 为
name: [
{ required: true, message: '请输入名字', trigger: 'blur | change' }
]
或者
name: [
{ required: true, message: '请输入名字', trigger: [ 'blur' ,'change'] }`
]
小小建议
1条答案
按热度按时间jc3wubiy1#
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.