what is the correct way to add an optional validation object in vuelidate?
Given a validation shape of:
validations: {
vehicles: {
$each: {
type: {
required
},
engine: {
required: requiredIf((vehicle) => vehicle.type == 'car'),
size: {
required
},
power: {
required
}
}
}
}
}
My expectation was that for a vehicle of type bike
I would not need to provide a size and power as their parent engine
is not required. However the validation is returning invalid.