I have the following setup in the App.vue
:
<top-nav></top-nav>
<main>
<router-view v-bind="{isOnline}"></router-view>
</main>
And in the top-nav
's js I have the goBack
method:
methods: {
goBack() {
this.$router.go(-1);
},
...
},
This works just fine in Chrome and Internet Explorer, not Safari though. When debugging and setting a breakpoint on that .go(-1)
-line it hits the breakpoint and everything looks fine (nothing undefined). The navigation call isn't done though.
This doesn't work on mobile nor desktop. I thought Safari had support for the History API?
I found out that the icon I used for going back was wrapped in an anchor tag with a set href
attribute.
<a v-if="showBackButton" href="#" @click="goBack">
<i class="icon icon-200-chevron-left-small"></i>
<p>back</p>
</a>
Change the anchor tag to a span or something and of course remove the href attribute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With