Currently, I'm working on enhancing a Vue application. My goal is to retrieve the value of the previously visited page using history.go(-1) and then use that value to assign certain values to a variable.
This is what I have in mind:
<script>
created: function() {
var str = history.go(-1)
if (str.includes("/users/")) {
console.log("Value found");
}
else {
console.log("Not Found");
}
}
</script>
I attempted this approach, but unfortunately, it did not yield the desired results for me.