<router-link
to="/foo"
v-slot="{ href, route, navigate, isActive, isExactActive }"
custom
>
<li
:class="[isActive && 'router-link-active', isExactActive && 'router-link-exact-active']"
>
<a :href="href" @click="navigate">{{ route.fullPath }}</a>
</li>
</router-link>
<!-- literal string -->
<router-link to="home">Home</router-link>
<!-- renders to -->
<a href="home">Home</a>
<!-- javascript expression using `v-bind` -->
<router-link v-bind:to="'home'">Home</router-link>
<!-- Omitting `v-bind` is fine, just as binding any other prop -->
<router-link :to="'home'">Home</router-link>
<!-- same as above -->
<router-link :to="{ path: 'home' }">Home</router-link>
<!-- named route -->
<router-link :to="{ name: 'user', params: { userId: 123 }}">User</router-link>
<!-- with query, resulting in `/register?plan=private` -->
<router-link :to="{ path: 'register', query: { plan: 'private' }}"
>Register</router-link
>