My v-bind:class
code is as follows:
<div v-bind:class="{ showBranding: brandingEnabled }">BRANDING</div>
Even when the value of brandingEnabled
in my data changes from true to false, the class remains unaffected.
However, everything works perfectly if I use this code instead:
<div v-bind:class="{ showBranding: (brandingEnabled == 'true') }">BRANDING</div>
Could there be an issue with how booleans are treated as strings? I have attempted setting them to true rather than "true" in my Vue data but it hasn't made a difference.
I've also tried setting the data type as Boolean through props, but that didn't solve the problem either.
If possible, I would prefer to stick with the simple syntax... Any assistance on resolving this issue would be greatly appreciated!