Page reroute with Vue – Vue router redirect example
Posted on: February 18, 2021 by Prince Chukwudire
Core to the simplicity heralded in Vuejs is its router component (Vue router). Apart from offering dynamic routing and allowing the user to pass in params during routing, the router is also capable of allowing one to do a total re-route to a different URL.
Vue router redirect example
This is similar to what vanilla Js offers us in
window.location.href = "some url"
Here’s how to achieve the same using the vue router:
router.push("some url")
Share on social media
//