2022-01-25 12:29:11 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
const route = useRoute()
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2022-03-23 08:44:36 +00:00
|
|
|
<NuxtExampleLayout show-tips example="with-middleware">
|
2022-01-25 12:29:11 +00:00
|
|
|
<NuxtPage />
|
|
|
|
|
|
|
|
<template #nav>
|
|
|
|
<nav class="flex align-center gap-4 p-4">
|
|
|
|
<NuxtLink to="/" class="n-link-base">
|
|
|
|
Home
|
|
|
|
</NuxtLink>
|
|
|
|
<NuxtLink to="/forbidden" class="n-link-base">
|
|
|
|
Forbidden
|
|
|
|
</NuxtLink>
|
|
|
|
<NuxtLink to="/redirect" class="n-link-base">
|
|
|
|
Redirect
|
|
|
|
</NuxtLink>
|
|
|
|
</nav>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
<div class="text-center p-4 op-50">
|
|
|
|
Current route: <code>{{ route.path }}</code>
|
|
|
|
</div>
|
|
|
|
</template>
|
2022-03-23 08:44:36 +00:00
|
|
|
<template #tips>
|
|
|
|
<div>
|
|
|
|
<p>This example shows how to add route middleware with the <code>middleware/</code> directory or with a plugin, and how to use them globally or per page.</p>
|
|
|
|
<a href="https://v3.nuxtjs.org/docs/directory-structure/middleware" target="_blank">
|
|
|
|
Read more about middleware
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</template>
|
2022-01-25 12:29:11 +00:00
|
|
|
</NuxtExampleLayout>
|
|
|
|
</template>
|