I cannot for the life of me figure this out.
I want
- User clicks checkbox
- Then based on separate conditions
- Checkbox data value & rendered value are calculated separately and return checked / unchecked
I can get:
- The data value to calculate and interpolate properly
But I fail at:
- If a
false
checkbox is clicked and the data calculationreturns false
, the checkbox still toggles onscreen to checked and unchecked
I’ve tried:
- Using a v-model with a custom setter that does the calculation and sets the local state which the custom get returns
- Imitating a v-model using
@change.prevent.stop="updateCalculatedValue"
and:checked="calculatedValue"
- Assuming the @change happens after the @click (which i think is wrong) and using
@click.prevent.stop="updateCalculatedValue"
and:checked="calculatedValue"
The model is working and rendering the calculated value as string in a DOM span, but the checked value doesn't seem to respect the model value
Can someone please help me out?
Aucun commentaire:
Enregistrer un commentaire