I'm just starting with Vue and vuelidate. I have a form which shall work in the following way:
- The form shows a Yes/No radio button group.
- If the radio button "Yes" is selected then the form shows a checkbox.
- The submit button for the form shall be enabled if one of the following conditions is true:
- The radio button is set to "No". OR
- The radio button is set to "Yes" AND the checkbox is checked.
I'm having trouble with the conditions described in 3. My current validation looks like this:
termsAccepted: { checked: value => value === true }
This basically works for case 3.2 but not for 3.1. In that case the form is still disabled.
b-form-checkbox#termsAccepted(
v-model="termsAccepted"
:state="!$v.termsAccepted.$invalid"
:disabled="disableForm"
)