Nuxt/test/fixtures/basic/pages/[...slug].vue
2023-05-09 18:08:07 +01:00

19 lines
490 B
Vue

<template>
<div>
<h1>[...slug].vue</h1>
<div>catchall at {{ route.params.slug?.[0] }}</div>
<div>Middleware ran: {{ !!($route.meta.override as any)?.includes('extended middleware') }}</div>
</div>
</template>
<script setup lang="ts">
definePageMeta({
middleware: ['override'],
validate: to => to.path !== '/forbidden'
})
const route = useRoute('slug')
if (route.path.includes('navigate-some-path')) {
throw createError('navigate-some-path setup running')
}
</script>