title: Changing CSS classes dynamically with vue js
body: <p>I have been using vue for about a month now but one thing that I haven't really been able to do properly yet is this. </p>
  
  <p>so in twig we can do something like this </p>
  
  <pre><code>&lt;th class=" 
    {% if condition %}
        class1
    {% else %}      
        class2
    {% end if %}  
  "&gt;
  
  &lt;th class="sorting_asc" v-for="col in columns" v-if="col.label == sortKey"&gt;
  &lt;th class="sorting" v-for="col in columns" v-else&gt;
  </code></pre>
  
  <p>So my first issue is I can't seem to be able to achieve something similar in Vue js. And secondly where I've written 'v-if="col.label == sortKey"', Can I even access the car col.label outside of the html block (outside the loop). Thank you in advanced</p>