title: Vue.js anchor to div within the same component
body: <p>I'm developing a Vue.js application and I'm having trouble to link an anchor to a certain div within a component.</p>
  
  <p>I have the following anchor:</p>
  
  <pre><code>&lt;a href="#porto" class="porto-button"&gt;Porto, Portugal&lt;/a&gt;
  </code></pre>
  
  <p>and the following div:</p>
  
  <pre><code>&lt;div id="porto" class="fl-porto"&gt;
  </code></pre>
  
  <p>I'm using vue-router in hash mode. </p>
  
  <p>The problem is, whenever I click the "porto-button" it will redirect me to the "home" page ( ' / ' )</p>
  
  <p>I'm using Vue.js 1.X and I tried using history mode (URL without the hashbang) but it gives me a <code>cannot GET '/page'</code> error upon refreshing a page.</p>
  
  <p>Am I doing something wrong? What can I do about this?</p>