Check out example codes for "vue if echo class". It will help you in understanding the concepts better.

Code Example 1

<div class="defaultclass" :class="condition?' conditionalclasstoappend':''"></div>

Code Example 2

<div v-bind:class="{ active: isActive }"></div>

Learn ReactJs, React Native from akashmittal.com