vuelidate create validation object code example
Example 1: vuelidate required if another props
elements: {
$each: {
type: {
required,
},
question: {
required: requiredIf(prop => prop.type === 'input'),
}
}
}
Example 2: vuelidate require if
required: requiredIf(()=> { return condition })