title: Remove a script from the index.html file depending on the path in Vue
body: <p>I am working on a Vue project, and I have a problem, it is that in the index.html file I have added a script that adds a chat to the page.
  I just want the chat to appear in some paths ('/', '/ profile' ...)</p>
  <p>I've tried putting an if (window.location.pathname === '/') {.... and it doesn't work as it only works if the page is reloaded, but it doesn't work dynamically.</p>
  <p>How could I do it?</p>