F
F
fisherspoons2021-10-07 20:55:37
Vue.js
fisherspoons, 2021-10-07 20:55:37

When the checkbox is enabled, at least one checkbox from the group must be selected?

There is a conditional checkbox (available), if it is enabled, 2 selects and at least 1 checkbox from the list of roles should be selected, I made a dependency for the selects, but I can’t figure out how to do it for the role selects.

https://codesandbox.io/s/little-silence-bfjnc?file...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
fisherspoons, 2021-10-07
@fisherspoons

https://codesandbox.io/s/little-silence-bfjnc?file...
solution

A
Aetae, 2021-10-07
@Aetae

Too lazy to delve into, but the solution is standard: instead of v-model, use a combination of @input and :value/:checked, where you need to put the necessary condition on the change event.
Or, as a value, use computed with set and get, where in set to check the condition.
Or, on the edge, use watch and, again, by condition, return as it was.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question