Is there a way to detect the back function in the browser and then redirect to a different page using Vue.js? Here's what I've tried so far.
mounted: function () {
window.onpopstate = function(event) {
this.$router.push({
path: "/register"
});
};
}
However, it seems that $router is not being recognized as a function. How can I go about solving this issue?