So i implemented a back button that works similar to the browser back button. But i want it to be a disabled button if the next click would leave the site (idc about the browser button mind you). Is there any way to check if going back further would leave the site or at least warn the user they are about to leave? right now i have this and i'm using Vue.js:
<div @click="goBack"></div>
goBack: function () {
this.$router.go(-1)
}