Trigger type of el-form form validation

//第一种
{
    
    
	required: true,
	message: '请输入字典项',
	trigger: 'blur'
},
//第二种
{
    
    
	required: true,
	message: '请输入字典项',
	trigger: 'change'
},
//第三种
{
    
    
	pattern: /^[A-Za-z0-9_]+$/,
	message: '字典项只能由 大小写字母、数字、下划线组成',
	trigger: ['blur', 'change']
}

The function of trigger type of blur is that the text box loses focus to trigger the
trigger type of change function is that the text box triggers the
trigger type when inputting content. You can also use blur and change at the same time. The function combines the above two functions.

Guess you like

Origin blog.csdn.net/weixin_43908123/article/details/108755594