I have a span showing an account balance. You can click on it to edit that balance. You can see below I'm applying the class hidden to the elements when the editing variable is changed.
<span @click="updateEditAccount(true, false)" v-bind:class="{ hidden: account.editing == true }">Balance ${{ account.balance }}</span>
<input v-bind:class="{ hidden: account.editing == false }" type="number" step="0.01" v-model="account.balance" >
This is the method that changes that value
updateEditAccount(editValue, updateLedger) {
this.account.editing = editValue
alert(this.account.editing)
if(updateLedger) {
}
},
When I set the initial value to true or false it displays the correct one. When the method is called I can see that the value is changed correctly.
The hidden class is simplye a display:none;
So the value does change, but the visible element doesn't change.