element [Feature Request] 关于form的触发校验的 trigger 建议

fhg3lkii  于 2022-10-22  发布在  其他
关注(0)|答案(1)|浏览(255)

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'] }`
        ]

小小建议

jc3wubiy

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.

相关问题