Search⌘ K

Navigation

Explore how to change routes in Vue 3 applications using the <router-link> component and programmatic navigation methods such as push, replace, and go. Understand how these approaches control browser history and enable dynamic user navigation within your app.

Changing the current routeThe "current route" refers to the specific page or URL path that the user is currently viewing or navigating within a web application. is achieved in two ways: via the <router-link> component and programmatically.

Links

While we could just use a standard <a> tag, the <router-link> component that Vue Router provides has several advantages:

  • It automatically applies a CSS class of “active” when the URL matches the current route (the class name can be configured by setting the router’s linkActiveClass option). ...