title: Vue - If class exist on router-page then display another class
body: <p>Im new to Vue and struggling with a simple task, in some router-pages i have a class &quot;1&quot; and if that exist i want another class &quot;2&quot; to be displayed.</p>
  <p>I installed jQuery first on main.js like this:</p>
  <pre><code>import jQuery from 'jquery'
  global.jQuery = jQuery
  </code></pre>
  <p>Then im using this code in the app.vue at the  tag but the page goes white, maybe i need to write something before?</p>
  <pre><code>&lt;script&gt;
  export default {
    name: 'App',
  }
  
  setTimeout(function(){
      document.body.className=&quot;&quot;;
  },200);
  
  // The code below is the one
  $('.1').toggle($('.2').length &gt; 0);
  &lt;/script&gt;
  </code></pre>
  <p>So i tried instead pasting the same line on the bottom of main.js, the page loads in but the code dosnt do anything. What am i doing wrong :(? Is that line i found javascript or jquery?</p>