Using Quasar I created these 2 input fields:
<q-input
dense
v-model=”itemToEdit.item.total_amount”
label=”Initial Amount”
:min=”1″
:max=”itemToEdit.item.initial_amount_value”
@update:model-value=”updateInitialAmount”
/>
<q-input
dense
v-model=”secondaryAmount”
label=”Secondary Amount”
:min=”0″
:max=”itemToEdit.item.total_amount – 1″
@update:model-value=”updateSecondaryAmount”
/>
I tried to implement the updateInitialAmount and updateSecondaryAmount.
What I want to do is the following:
If I decrease/increase the value of the first input field I want that same amount to do the opposite in the other input field (if in first input I have 10 and I subtract 2, -> first input = 8, second input = 2), also after that I want to be able to increase back the value of the first input to 9 or 10 and decrease the value of the second one.
I want the same behavior for the second input. Does anyone have any idee about how can I achieve this? I need to do it without the Watch
Lm99 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.