title: VueJS: Adding a class to one element if a class exists on another element
body: <p>I'm working in VueJS. I'm trying to bind a class to one element based on an existence of a class on another element. The below is in a :for loop to print out the list.</p>
  
  <p></p>
  
  <p>The <code>'#accordion-'+(index+1))</code> is the id of the div I want to check to see if a class exists on it.</p>
  
  <p>I wrote a method and it works UNTIL I check the element's classList. Right now, I'm only doing a console log, but eventually this will return true and hopefully the class will apply.</p>
  
  <pre><code>methods: {
    existingTopic: function(lcDivID) {
      const element = document.querySelector(lcDivID);
      console.log(element); //It gives me the element.
      /* The below is where it crashes */
      console.log(element.classList.contains("collapsePanelExistingTopic"));
    }
  }
  </code></pre>
  
  <p>I find it so frustrating. I've spent a day on this without any results. Any help you can provide it would be great.</p>