BlogPlaygroundOne

Routing

Routing is the process of navigating between different views or pages in an application.

Edit this page
Copy Page as Markdown

Guide

Vue Router is the official router for Vue. It allows you to define routes and map them to components, enabling navigation between different views in your application.

The following components have built in support for routing:

These components can act like a router-link and have access to props such as to and exact:

<v-btn to="/home" text="Home"></v-btn>

Router view transitions

Vue Router lets you add transitions between different views. The router-view component is used to render the current route’s component, and you can use the transition component to add transitions between different views.

src/App.vue
<template>
  <v-app>
    <v-app-bar app>
      <v-toolbar-title>My App</v-toolbar-title>
    </v-app-bar>

    <v-main>
      <router-view v-slot="{ Component }">
        <v-fade-transition hide-on-leave>
          <component :is="Component" />
        </v-fade-transition>
      </router-view>
    </v-main>
  </v-app>
</template>

Visit the Transitions page for more information.

Ready for more?

Continue your learning with related content selected by the Team or move between pages by using the navigation links below.