I want to bind a class to an element based on the result of a boolean expression. For example:
<input type="email" :class="{ invalid: submitted && $v.email.$error }">
But the "invalid" class is not added to the element if I evaluate both conditions; it only works when I evaluate one or the other, for example:
<input type="email" :class="{ invalid: submitted }">
or
<input type="email" :class="{ invalid: $v.email.$error }">
work just fine. I realize I could use computed properties for this, but I'd have to create a computed property for each field in my web form and that seems redundant. Is there a better way?