Question: I used CSS utility classes for building components in VueJS. The problem I ran into was that I wanted to apply classes only when certain conditions are met, i.e. style the component slightly differently based on its state. This caused me to check the condition repeatedly – once per class I want to apply. Is there a better way, e.g. applying all classes together after checking once? TypeScript/JavaScript: ex…
https://vuejs.org/v2/guide/class-and-style.html#Binding-HTML...
https://vuejs.org/v2/guide/class-and-style.html#Array-Syntax
In your template:
a)
b)