I'm developing a Vue.js application and I'm having trouble to link an anchor to a certain div within a component.
I have the following anchor:
<a href="#porto" class="porto-button">Porto, Portugal</a>
and the following div:
<div id="porto" class="fl-porto">
I'm using vue-router in hash mode.
The problem is, whenever I click the "porto-button" it will redirect me to the "home" page ( ' / ' )
I'm using Vue.js 1.X and I tried using history mode (URL without the hashbang) but it gives me a cannot GET '/page'
error upon refreshing a page.
Am I doing something wrong? What can I do about this?
<div id="porto" class="fl-porto">
, no? – Kori John Roys<a name="porto">
, then youra href="#porto">
should work. – Kori John Royscannot GET /page
whenever I refresh the page I am in – fmlopes